Merge branch 'ignore_empty' into 'master'

unl0kr-agent: ignore keys without a value in requests

See merge request postmarketOS/buffybox!45
This commit is contained in:
Johannes Marbach
2025-04-09 13:09:03 +00:00

View File

@@ -118,18 +118,16 @@ bool to_bool(const char* value)
{
if (strcmp(value, "true") == 0) {
return true;
} else if (strcmp(value, "1") == 0) {
return true;
} else if (strcmp(value, "yes") == 0) {
return true;
} else if (strcmp(value, "false") == 0) {
return false;
} else if (strcmp(value, "1") == 0) {
return true;
} else if (strcmp(value, "0") == 0) {
return false;
} else if (strcmp(value, "yes") == 0) {
return true;
} else if (strcmp(value, "no") == 0) {
return false;
} else if (strcmp(value, "") == 0) {
return false;
} else {
fprintf(stderr, "The value '%s' is not a boolean\n", value);
return false;
@@ -145,6 +143,11 @@ int ini_parser(void* user, const char* section, const char* name, const char* va
return 0;
}
if (value[0] == 0x00) {
fprintf(stderr, "The ini file contains a key without a value: %s\n", name);
return 0;
}
if (strcmp(name, "NotAfter") == 0) {
d->not_after = atol(value);
} else if (strcmp(name, "Socket") == 0) {