Repository navigation
[c25] Implement safe guard against potential std::string constructor with NULL pointer - #8188
Merged
Merged
Conversation
Change-Id: I8a436437a3b65245426f365d66e3cc801cafed13
Contributor
There was a problem hiding this comment.
Code Review
This pull request effectively addresses a potential crash by safeguarding against the construction of a std::string from a NULL pointer. The change is correct and directly solves the issue described. My review includes one suggestion to make the std::string construction explicit, which would improve code clarity and consistency by avoiding reliance on implicit type conversions.
Change-Id: I6fb0ddad91b9aecbd171118938435840660f4da5
lamdbui
requested review from
andrewsavage1,
hlwarriner,
xiaomings,
y4vor and
yell0wd0g
January 12, 2026 21:35
hlwarriner
approved these changes
Jan 12, 2026
lamdbui
enabled auto-merge (squash)
January 12, 2026 21:48
y4vor
approved these changes
Jan 12, 2026
oxve
disabled auto-merge
January 14, 2026 20:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amazon are trying to rollout C25, but running into a high number of crashes on Cobalt version 5.30.2
The stacktrace points to an error with string handling around SbPlayerCreate. The stacktrace points to DecoderStatusCB, but the PlayerErrorCB function is also in the trace and is a more likely culprit due to its handling of a const char* message.
The crash is likely happening when a std::string is implicitly created from the message argument, which is a const char*. This can happen in two places inside PlayerErrorCB:
If message is a null pointer, the first case will crash. The second case is already handling the null case correctly.
This change implements a defensive check against that happening, by replacing a NULL pointer with an empty string.
Bug: 455621481