pcrlock: check for embedded NUL bytes

This commit is contained in:
Lennart Poettering 2023-11-20 14:26:18 +01:00
parent 8c8d2cfd4b
commit c7da9e9a65

View File

@ -1125,6 +1125,11 @@ static int event_log_load_userspace(EventLog *el) {
b[bn] = 0; /* Turn it into a string */
if (memchr(b, 0, bn)) {
log_warning("Found record with embedded NUL byte, skipping.");
continue;
}
r = json_parse(b, 0, &j, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Failed to parse local TPM measurement log file: %m");