mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 01:06:09 +00:00
wacom-usb: Fix a false positive in real world firmware
Some files have a newline inbetween the AB sections.
This commit is contained in:
parent
5d4e70e9cc
commit
6817648c6b
@ -52,10 +52,15 @@ fu_wac_firmware_parse(FuFirmware *firmware,
|
|||||||
/* parse each line */
|
/* parse each line */
|
||||||
lines = fu_common_strnsplit((const gchar *)data, len, "\n", -1);
|
lines = fu_common_strnsplit((const gchar *)data, len, "\n", -1);
|
||||||
for (guint i = 0; lines[i] != NULL; i++) {
|
for (guint i = 0; lines[i] != NULL; i++) {
|
||||||
g_autofree gchar *cmd = g_strndup(lines[i], 2);
|
g_autofree gchar *cmd = NULL;
|
||||||
|
|
||||||
/* remove windows line endings */
|
/* remove windows line endings */
|
||||||
g_strdelimit(lines[i], "\r", '\0');
|
g_strdelimit(lines[i], "\r", '\0');
|
||||||
|
cmd = g_strndup(lines[i], 2);
|
||||||
|
|
||||||
|
/* ignore blank lines */
|
||||||
|
if (g_strcmp0(cmd, "") == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Wacom-specific metadata */
|
/* Wacom-specific metadata */
|
||||||
if (g_strcmp0(cmd, "WA") == 0) {
|
if (g_strcmp0(cmd, "WA") == 0) {
|
||||||
@ -191,7 +196,8 @@ fu_wac_firmware_parse(FuFirmware *firmware,
|
|||||||
g_set_error(error,
|
g_set_error(error,
|
||||||
FWUPD_ERROR,
|
FWUPD_ERROR,
|
||||||
FWUPD_ERROR_INTERNAL,
|
FWUPD_ERROR_INTERNAL,
|
||||||
"invalid SREC command: %s",
|
"invalid SREC command on line %u: %s",
|
||||||
|
i + 1,
|
||||||
cmd);
|
cmd);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user