Skip to content

Commit 66b6bb7

Browse files
authored
Fix crash in command arg parsing with nullptr string
As reported here: #4907 (comment)
1 parent 2811f40 commit 66b6bb7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/src/Helpers/StringConverter.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,9 @@ bool GetArgv(const char *string, String& argvString, unsigned int argc, char sep
14641464
bool GetArgvBeginEnd(const char *string, const unsigned int argc, int& pos_begin, int& pos_end, char separator) {
14651465
pos_begin = -1;
14661466
pos_end = -1;
1467+
if (string == nullptr) {
1468+
return false;
1469+
}
14671470
size_t string_len = strlen(string);
14681471
unsigned int string_pos = 0, argc_pos = 0;
14691472
bool parenthesis = false;

0 commit comments

Comments
 (0)