1 --- misc/hunspell-1.3.2/src/hunspell/affixmgr.cxx 2010-02-27 12:59:53.000000000 +0100
2 +++ misc/build/hunspell-1.3.2/src/hunspell/affixmgr.cxx 2011-05-18 16:29:45.919141893 +0200
9 #include "affixmgr.hxx"
10 #include "affentry.hxx"
11 #include "langnum.hxx"
12 @@ -4000,7 +4002,10 @@
15 numents = atoi(piece);
17 + if ((numents <= 0) ||
18 + ((::std::numeric_limits<size_t>::max()
19 + / sizeof(struct affentry)) < numents))
21 char * err = pHMgr->encode_flag(aflag);
23 HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
24 --- misc/hunspell-1.3.2/src/tools/munch.c 2010-02-27 21:49:49.000000000 +0100
25 +++ misc/build/hunspell-1.3.2/src/tools/munch.c 2011-05-18 15:53:53.427072106 +0200
32 #include <sys/types.h>
35 case 1: { achar = *piece; break; }
36 case 2: { if (*piece == 'Y') ff = XPRODUCT; break; }
37 case 3: { numents = atoi(piece);
38 - ptr = malloc(numents * sizeof(struct affent));
41 - fprintf(stderr,"parsing %c entries %d\n",achar,numents);
42 + if ((numents < 0) ||
43 + ((SIZE_MAX/sizeof(struct affent)) < numents))
46 + "Error: too many entries: %d\n", numents);
49 + ptr = malloc(numents * sizeof(struct affent));
52 + fprintf(stderr,"parsing %c entries %d\n",
58 --- misc/hunspell-1.3.2/src/tools/unmunch.c 2010-02-23 15:53:29.000000000 +0100
59 +++ misc/build/hunspell-1.3.2/src/tools/unmunch.c 2011-05-18 20:53:43.843599726 +0200
66 #include <sys/types.h>
69 case 1: { achar = *piece; break; }
70 case 2: { if (*piece == 'Y') ff = XPRODUCT; break; }
71 case 3: { numents = atoi(piece);
72 - ptr = malloc(numents * sizeof(struct affent));
75 - fprintf(stderr,"parsing %c entries %d\n",achar,numents);
76 + if ((numents < 0) ||
77 + ((SIZE_MAX/sizeof(struct affent)) < numents))
80 + "Error: too many entries: %d\n", numents);
83 + ptr = malloc(numents * sizeof(struct affent));
86 + fprintf(stderr,"parsing %c entries %d\n",