Commit Graph

4 Commits

Author SHA1 Message Date
Richard Hughes
0c51630991 Check firmware magic in a more standard way
Some parsers are ignoring the magic when using _FLAG_IGNORE_CHECKSUM
(which is wrong; fuzzers have no problem with enforcing a static prefix)
and other either disregard the offset or check the magic in an unsafe
way. Also, use FWUPD_ERROR_INVALID_FILE consistently for magic failure.

Add a vfunc, and move all the clever code into one place.
2022-07-14 14:48:15 +01:00
Richard Hughes
56e5c1b7a9 Fix critical warning when parsing invalid FDT firmware
Never let firmware_current be NULL by checking for the root node ENDing.

Fixes https://oss-fuzz.com/testcase-detail/5454411320655872
2022-07-13 22:04:01 +01:00
Richard Hughes
3b71918346 trivial: Remove some dead code spotted by Coverity 2022-07-11 10:17:59 +01:00
Richard Hughes
f3755ef708 Add support for Flattened Devicetree aka FDT firmware 2022-07-08 14:05:20 +01:00