mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
StringImpl: Fix possible uninitialized access in StringImpl::create().
If the provided length is 0, there's no need to dereference the const char*.
This commit is contained in:
parent
643a43f278
commit
583606a2b1
Notes:
sideshowbarker
2024-07-19 13:29:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/583606a2b1e
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ RefPtr<StringImpl> StringImpl::create(const char* cstring, int length, ShouldCho
|
|||
if (!cstring)
|
||||
return nullptr;
|
||||
|
||||
if (!*cstring)
|
||||
if (!length || !*cstring)
|
||||
return the_empty_stringimpl();
|
||||
|
||||
if (should_chomp) {
|
||||
|
|
Loading…
Reference in a new issue