From: Mark Andrews Date: Mon, 18 Oct 2010 04:06:37 +0000 (+0000) Subject: 2966. [bug] isc_print_vsnprintf() failed to check if there was X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a63e455cf7c85b0b4cdc59a5f1dea2f148943a4a;p=thirdparty%2Fbind9.git 2966. [bug] isc_print_vsnprintf() failed to check if there was space available in the buffer when adding a left justified character with a non zero width, (e.g. "%-1c"). [RT #22270] --- diff --git a/CHANGES b/CHANGES index c0d63622eeb..e80a7dfaf07 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +2966. [bug] isc_print_vsnprintf() failed to check if there was + space available in the buffer when adding a left + justified character with a non zero width, + (e.g. "%-1c"). [RT #22270] --- 9.5.3rc1 released --- diff --git a/lib/isc/print.c b/lib/isc/print.c index a64aaf536a0..df78f315ba3 100644 --- a/lib/isc/print.c +++ b/lib/isc/print.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: print.c,v 1.33.128.2 2008/02/18 23:46:30 tbox Exp $ */ +/* $Id: print.c,v 1.33.128.3 2010/10/18 04:06:37 marka Exp $ */ /*! \file */ @@ -468,7 +468,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) { if (width > 0) { count += width; width--; - if (left) { + if (left && size > 1) { *str++ = c; size--; }