]> cvs.zerfleddert.de Git - rsbs2/commitdiff
more paranoia (check consistency after patching the image, too)
authorMichael Gernoth <michael@gernoth.net>
Sun, 1 Feb 2009 13:55:54 +0000 (14:55 +0100)
committerMichael Gernoth <michael@gernoth.net>
Sun, 1 Feb 2009 13:55:54 +0000 (14:55 +0100)
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