diff options
Diffstat (limited to 'package/system/fwtool/src/fwtool.c')
-rw-r--r-- | package/system/fwtool/src/fwtool.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/package/system/fwtool/src/fwtool.c b/package/system/fwtool/src/fwtool.c index 3adc1e0249..89e89514ad 100644 --- a/package/system/fwtool/src/fwtool.c +++ b/package/system/fwtool/src/fwtool.c @@ -328,12 +328,14 @@ extract_data(const char *name) if (extract_tail(&dbuf, &tr, sizeof(tr))) break; - data_len = be32_to_cpu(tr.size) - sizeof(tr); if (tr.magic != cpu_to_be32(FWIMAGE_MAGIC)) { msg("Data not found\n"); + metadata_keep = true; break; } + data_len = be32_to_cpu(tr.size) - sizeof(tr); + if (be32_to_cpu(tr.crc32) != tail_crc32(&dbuf, crc32)) { msg("CRC error\n"); break; |