mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-27 09:46:25 +00:00
trivial: fu-engine: skip empty cmdline commands
g_strsplit returns an empty vector for an empty string, which leads to assertion in g_strv_contains when /proc/cmdline ends with a space.
This commit is contained in:
parent
01ba0c1eea
commit
a8b3f9ed57
@ -1620,7 +1620,10 @@ fu_engine_get_report_metadata_kernel_cmdline (GHashTable *hash, GError **error)
|
||||
g_auto(GStrv) tokens = fu_common_strnsplit (buf, bufsz - 1, " ", -1);
|
||||
g_autoptr(GString) cmdline_safe = g_string_new (NULL);
|
||||
for (guint i = 0; tokens[i] != NULL; i++) {
|
||||
g_auto(GStrv) kv = g_strsplit (tokens[i], "=", 2);
|
||||
g_auto(GStrv) kv = NULL;
|
||||
if (strlen (tokens[i]) == 0)
|
||||
continue;
|
||||
kv = g_strsplit (tokens[i], "=", 2);
|
||||
if (g_strv_contains (ignore, kv[0]))
|
||||
continue;
|
||||
if (cmdline_safe->len > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user