mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 02:39:16 +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 */
|
/* check starting token */
|
||||||
if (line[0] != 'S') {
|
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,
|
g_set_error (error,
|
||||||
FWUPD_ERROR,
|
FWUPD_ERROR,
|
||||||
FWUPD_ERROR_INVALID_FILE,
|
FWUPD_ERROR_INVALID_FILE,
|
||||||
"invalid starting token, got '%c' at line %u",
|
"invalid starting token at line %u",
|
||||||
line[0], ln + 1);
|
ln + 1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user