]> git.zerfleddert.de Git - rsbs2/blobdiff - firmware.c
more paranoia (check consistency after patching the image, too)
[rsbs2] / firmware.c
index fb5b007e5b2b8e9e3968c740286b90d01f8a8ed2..605611112fbff47ec5d18ac41a4c313b3da84884 100644 (file)
@@ -501,6 +501,11 @@ int main(int argc, char **argv)
                        *((unsigned int*)(fw + statbuf.st_size - 4)) = crc;
                }
 
+               if (check_image(fw, statbuf.st_size-4) != 0) {
+                       fprintf(stderr, "corrupt firmware image found (pdata is not last entry), aborting!\n");
+                       exit(1);
+               }
+
                if (check_crc(fw, statbuf.st_size) == 0) {
                        char *newfile;
 
Impressum, Datenschutz