KhronosGroup / KhronosGroup/OpenCOLLADA

UB constructing std::string with 0

Open
#665 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
260
PR merge metrics
No merged PRs in 30d

Description

String is an alias for std::string
https://github.com/KhronosGroup/OpenCOLLADA/blob/6031fa956e1da4bbdd910af3a8f9e924ef0fca7a/COLLADAFramework/include/COLLADAFWPrerequisites.h#L18

and these two lines will construct std::string with a null pointer, which is undefined behaviour:

https://github.com/KhronosGroup/OpenCOLLADA/blob/6031fa956e1da4bbdd910af3a8f9e924ef0fca7a/COLLADAFramework/src/COLLADAFWRenderState.cpp#L53

https://github.com/KhronosGroup/OpenCOLLADA/blob/6031fa956e1da4bbdd910af3a8f9e924ef0fca7a/COLLADAFramework/include/COLLADAFWMeshVertexData.h#L121

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the String alias in COLLADAFramework/include/COLLADAFWPrerequisites.h, then inspect the two referenced constructions in COLLADAFWRenderState.cpp and COLLADAFWMeshVertexData.h. Trace the affected initialization paths and verify that neither constructs std::string from a null pointer while preserving the intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.