mirror of
https://git.proxmox.com/git/fwupd
synced 2025-04-28 16:44:23 +00:00
Fix a critical warning when parsing an empty kernel cmdline
Fix the bounds check so we never pass a bufsz of zero to fu_strsplit(). Resolves: https://github.com/fwupd/fwupd/issues/5575
This commit is contained in:
parent
2819653a3a
commit
c6fa4e97e7
@ -116,7 +116,7 @@ fu_common_is_live_media(void)
|
||||
return TRUE;
|
||||
if (!g_file_get_contents("/proc/cmdline", &buf, &bufsz, NULL))
|
||||
return FALSE;
|
||||
if (bufsz == 0)
|
||||
if (bufsz <= 1)
|
||||
return FALSE;
|
||||
tokens = fu_strsplit(buf, bufsz - 1, " ", -1);
|
||||
for (guint i = 0; args[i] != NULL; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user