From fd0958dc7caa5806b82b9757e2b937c5b7def369 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 11 Nov 2006 19:43:33 +0000 Subject: [PATCH] Fix buffer overflow reported by John Darrington. --- src/data/ChangeLog | 7 +++++++ src/data/data-out.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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; } } -- 2.30.2