1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-03 05:18:09 +03:00

analyze: C escape weird chars in SMBIOS fields

just in case, let's not write garbled crap to the TTY but escape and
potential weird chars before output.
This commit is contained in:
Lennart Poettering 2024-12-20 12:13:43 +01:00
parent 95cd07e772
commit 6b99f3ba5a

View File

@ -4,6 +4,7 @@
#include "analyze-chid.h"
#include "chid-fundamental.h"
#include "efi-api.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-table.h"
@ -209,7 +210,13 @@ int verb_chid(int argc, char *argv[], void *userdata) {
_cleanup_free_ char *c = NULL;
if (smbios_fields[f]) {
c = utf16_to_utf8(smbios_fields[f], SIZE_MAX);
_cleanup_free_ char *u = NULL;
u = utf16_to_utf8(smbios_fields[f], SIZE_MAX);
if (!u)
return log_oom();
c = cescape(u);
if (!c)
return log_oom();
}