The char array 'format' sometimes get 10 characters and when
authorjbj <devnull@localhost>
Mon, 16 Sep 2002 13:17:30 +0000 (13:17 +0000)
committerjbj <devnull@localhost>
Mon, 16 Sep 2002 13:17:30 +0000 (13:17 +0000)
strcpy is done on it, strcpy tries to add a '/0' to it beyond
the capacity. Not sure why, but, the const char *ch gets bad
address. Anyway, format should be atleast 11 chars to accommodate
strings like "%.34s\n%42s" and a terminating '\0'.

CVS patchset: 5708
CVS date: 2002/09/16 13:17:30

popt/popthelp.c

index 485fecd..4d8f0ef 100644 (file)
@@ -332,7 +332,7 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol,
 /*@-boundsread@*/
     while (helpLength > lineLength) {
        const char * ch;
-       char format[10];
+       char format[16];
 
        ch = help + lineLength - 1;
        while (ch > help && !isspace(*ch)) ch--;