Skip to content

Commit

Permalink
FIX: check NULL pointer before calling strlen
Browse files Browse the repository at this point in the history
  • Loading branch information
justadreamer committed Oct 31, 2024
1 parent 37c1aaa commit 66f6c56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion overrides.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static bool startsWith(String *string, String *prefix) {
*/
static const char* skipPrefix(bool prefixed, const char *field) {
char *result = (char*)field;
if (prefixed == true && strlen(result) > sizeof(OVERRIDE_PREFIX) &&
if (result && prefixed == true && strlen(result) > sizeof(OVERRIDE_PREFIX) &&
StringCompareLength(
field,
OVERRIDE_PREFIX,
Expand Down

0 comments on commit 66f6c56

Please sign in to comment.