From: John Darrington Date: Tue, 17 May 2005 13:53:38 +0000 (+0000) Subject: Fixed buffer overflow buglet (test/commands/bignum.sh crashed on gcc-2.95 ) X-Git-Tag: v0.4.0~71 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77e400ebcde847289260797535e5be5fea3f52dd;p=pspp-builds.git Fixed buffer overflow buglet (test/commands/bignum.sh crashed on gcc-2.95 ) --- diff --git a/src/data-out.c b/src/data-out.c index 5fce84f6..d21d2902 100644 --- a/src/data-out.c +++ b/src/data-out.c @@ -1042,7 +1042,7 @@ try_F (char *dst, const struct fmt_spec *fp, double number) /* There are no decimal places, so there's no way that the value can be shortened. Either it fits or it doesn't. */ - char buf[40]; + char buf[41]; sprintf (buf, "%*.0f", fp->w, number); if (strlen (buf) <= fp->w) {