mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 08:50:26 +03: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
@ -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 New Issue
Block a user