Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee94c5c

Browse filesBrowse files
authored
Fix crash in String when using nullptr (#10971)
Fixes: #10971
1 parent a7907cd commit ee94c5c
Copy full SHA for ee94c5c

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎cores/esp32/WString.cpp

Copy file name to clipboardExpand all lines: cores/esp32/WString.cpp
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ String &String::operator=(StringSumHelper &&rval) {
290290
#endif
291291

292292
String &String::operator=(const char *cstr) {
293-
return copy(cstr, strlen(cstr));
293+
const uint32_t length = cstr ? strlen(cstr) : 0u;
294+
return copy(cstr, length);
294295
}
295296

296297
/*********************************************/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.