Skip to content

[lldb] Prevent passing a nullptr to std::string in ObjectFileMachO (… #9547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

JDevlieghere
Copy link

llvm#100421)

Prevent passing a nullptr to std::string::insert in ObjectFileMachO::GetDependentModules. Calling GetCString on an empty ConstString will return a nullptr, which is undefined behavior. Instead, use the GetString helper which will return an empty string in that case.

rdar://132388027
(cherry picked from commit e846fb4)

…lvm#100421)

Prevent passing a nullptr to std::string::insert in
ObjectFileMachO::GetDependentModules. Calling GetCString on an empty
ConstString will return a nullptr, which is undefined behavior. Instead,
use the GetString helper which will return an empty string in that case.

rdar://132388027
(cherry picked from commit e846fb4)
@JDevlieghere
Copy link
Author

@swift-ci test

@JDevlieghere JDevlieghere merged commit f4146ce into stable/20240723 Nov 7, 2024
2 of 3 checks passed
@JDevlieghere JDevlieghere deleted the cherrypick-e846fb48038a34d8df3ad7412bbdcf37e9e7acc9 branch November 7, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant