mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 04:33:08 +00:00
trivial: Do not show unprintable text when parsing invalid SREC firmware
This commit is contained in:
parent
b28e325339
commit
647ec9677e
@ -110,11 +110,20 @@ fu_srec_firmware_tokenize (FuFirmware *firmware, GBytes *fw,
|
||||
|
||||
/* check starting token */
|
||||
if (line[0] != 'S') {
|
||||
g_autofree gchar *strsafe = fu_common_strsafe (line, 3);
|
||||
if (strsafe != NULL) {
|
||||
g_set_error (error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INVALID_FILE,
|
||||
"invalid starting token, got '%s' at line %u",
|
||||
strsafe, ln + 1);
|
||||
return FALSE;
|
||||
}
|
||||
g_set_error (error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INVALID_FILE,
|
||||
"invalid starting token, got '%c' at line %u",
|
||||
line[0], ln + 1);
|
||||
"invalid starting token at line %u",
|
||||
ln + 1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user