Skip to content

Commit 7bdc3c8

Browse files
authored
Merge pull request #3220 from eduar-hte/string-null
Creating a std::string with a null pointer is undefined behaviour
2 parents 3a83196 + 30a68de commit 7bdc3c8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

headers/modsecurity/rules_set_properties.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ class RulesSetProperties {
333333
case FalseConfigBoolean:
334334
return "False";
335335
case PropertyNotSetConfigBoolean:
336+
default:
336337
return "Not set";
337338
}
338-
return NULL;
339339
}
340340

341341

src/actions/transformations/url_encode.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ std::string UrlEncode::url_enc(const char *input,
4848
len = input_len * 3 + 1;
4949
d = rval = reinterpret_cast<char *>(malloc(len));
5050
if (rval == NULL) {
51-
return NULL;
51+
return {};
5252
}
5353

5454
/* ENH Only encode the characters that really need to be encoded. */

0 commit comments

Comments
 (0)