Skip to content

Commit

Permalink
Fix crash in String when using nullptr (espressif#10971)
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-er authored Feb 15, 2025
1 parent a7907cd commit ee94c5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cores/esp32/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ String &String::operator=(StringSumHelper &&rval) {
#endif

String &String::operator=(const char *cstr) {
return copy(cstr, strlen(cstr));
const uint32_t length = cstr ? strlen(cstr) : 0u;
return copy(cstr, length);
}

/*********************************************/
Expand Down

0 comments on commit ee94c5c

Please sign in to comment.