summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-04-14 09:59:47 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-04-14 09:59:47 +0000
commit6a42997d802cdd00f6803513e4ad7f442cadcefb (patch)
tree9218b970d63d4bd5d4114cc60626a5131fdc4667 /tools
parent20296f5796e8e91e60a9cbe96ca1a6384162d8f6 (diff)
downloadrockbox-6a42997d802cdd00f6803513e4ad7f442cadcefb.tar.gz
rockbox-6a42997d802cdd00f6803513e4ad7f442cadcefb.tar.bz2
rockbox-6a42997d802cdd00f6803513e4ad7f442cadcefb.zip
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
Diffstat (limited to 'tools')
-rw-r--r--tools/scramble.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/scramble.c b/tools/scramble.c
index 716b73b569..ca3cea5a58 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -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;
}