mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +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
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)
|
if (!cstring)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
if (!*cstring)
|
if (!length || !*cstring)
|
||||||
return the_empty_stringimpl();
|
return the_empty_stringimpl();
|
||||||
|
|
||||||
if (should_chomp) {
|
if (should_chomp) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue