From: Ben Pfaff Date: Sat, 11 Nov 2006 19:43:33 +0000 (+0000) Subject: Fix buffer overflow reported by John Darrington. X-Git-Tag: v0.6.0~698 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd0958dc7caa5806b82b9757e2b937c5b7def369;p=pspp-builds.git Fix buffer overflow reported by John Darrington. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 4be64ea9..c77770c4 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,10 @@ +Sat Nov 11 11:41:26 2006 Ben Pfaff + + Fix buffer overflow reported by John Darrington. + + * data-out.c (output_bcd_integer): In case of SYSMIS, etc., + realize that DIGITS is a count of nibbles, not of bytes. + Sat Nov 4 15:59:56 2006 Ben Pfaff * calendar.c (calendar_offset_to_gregorian) Also return the diff --git a/src/data/data-out.c b/src/data/data-out.c index ffc79ecc..6622c7d4 100644 --- a/src/data/data-out.c +++ b/src/data/data-out.c @@ -1026,7 +1026,7 @@ output_bcd_integer (double number, int digits, char *output) } else { - memset (output, 0, digits); + memset (output, 0, DIV_RND_UP (digits, 2)); return false; } }