1
0
Fork 0
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:
Linus Nielsen Feltzing 2003-04-14 09:59:47 +00:00
parent 20296f5796
commit 6a42997d80

View file

@ -52,6 +52,12 @@ int main (int argc, char** argv)
length = ftell(file); length = ftell(file);
length = (length + 3) & ~3; /* Round up to nearest 4 byte boundary */ 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); fseek(file,0,SEEK_SET);
inbuf = malloc(length); inbuf = malloc(length);
outbuf = malloc(length); outbuf = malloc(length);