Index: user/boottools/flashloader.c =================================================================== RCS file: /cvs/sw/new-wave/user/boottools/flashloader.c,v retrieving revision 1.2 diff -c -r1.2 flashloader.c *** user/boottools/flashloader.c 20 Aug 2001 06:38:58 -0000 1.2 --- user/boottools/flashloader.c 27 Jun 2002 21:54:36 -0000 *************** *** 7,13 **** _bsc2(int,program,void *,a1,int,a2) ! void *chain[128]; char spinner[] = { 8, '|' , 8, '\\' , 8, '-', 8, '/'}; --- 7,15 ---- _bsc2(int,program,void *,a1,int,a2) ! #define MAX_CHAIN_LEN 512 ! ! void *chain[MAX_CHAIN_LEN]; char spinner[] = { 8, '|' , 8, '\\' , 8, '-', 8, '/'}; *************** *** 35,40 **** --- 37,46 ---- chain[b] = malloc(4096); n = read(fd, chain[b++], 4096); write(1, &spinner[(b & 3) << 1], 2); + if (b >= MAX_CHAIN_LEN) { + printf("%s: file [%s] too large to load\n",argv[0], argv[1]); + exit(3); + } } printf("Loaded %d bytes\n",count);