forked from len0rd/rockbox
Magnus Öman's fix to prevent creation of >200K files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3552 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
20296f5796
commit
6a42997d80
1 changed files with 7 additions and 1 deletions
|
|
@ -52,6 +52,12 @@ int main (int argc, char** argv)
|
|||
length = ftell(file);
|
||||
length = (length + 3) & ~3; /* Round up to nearest 4 byte boundary */
|
||||
|
||||
if ((length + headerlen) >= 0x32000) {
|
||||
printf("error: max firmware size is 200KB!\n");
|
||||
fclose(file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fseek(file,0,SEEK_SET);
|
||||
inbuf = malloc(length);
|
||||
outbuf = malloc(length);
|
||||
|
|
@ -129,5 +135,5 @@ int main (int argc, char** argv)
|
|||
free(inbuf);
|
||||
free(outbuf);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue