Merge pull request #3220 from eduar-hte/string-null

Creating a std::string with a null pointer is undefined behaviour
This commit is contained in:
Ervin Hegedus
2024-08-09 17:37:47 +02:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -333,9 +333,9 @@ class RulesSetProperties {
case FalseConfigBoolean: case FalseConfigBoolean:
return "False"; return "False";
case PropertyNotSetConfigBoolean: case PropertyNotSetConfigBoolean:
default:
return "Not set"; return "Not set";
} }
return NULL;
} }

View File

@@ -48,7 +48,7 @@ std::string UrlEncode::url_enc(const char *input,
len = input_len * 3 + 1; len = input_len * 3 + 1;
d = rval = reinterpret_cast<char *>(malloc(len)); d = rval = reinterpret_cast<char *>(malloc(len));
if (rval == NULL) { if (rval == NULL) {
return NULL; return {};
} }
/* ENH Only encode the characters that really need to be encoded. */ /* ENH Only encode the characters that really need to be encoded. */