]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2966. [bug] isc_print_vsnprintf() failed to check if there was
authorMark Andrews <marka@isc.org>
Mon, 18 Oct 2010 04:06:37 +0000 (04:06 +0000)
committerMark Andrews <marka@isc.org>
Mon, 18 Oct 2010 04:06:37 +0000 (04:06 +0000)
                        space available in the buffer when adding a left
                        justified character with a non zero width,
                        (e.g. "%-1c"). [RT #22270]

CHANGES
lib/isc/print.c

diff --git a/CHANGES b/CHANGES
index c0d63622eeb0d83d0ca699236e75c94e7519d7a0..e80a7dfaf073ed6ee366746234e784d2e754c661 100644 (file)
--- 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 ---
 
index a64aaf536a026e8e16809572979180ba8e52cb38..df78f315ba3faa83a59a142304bc6fa6c7d36a96 100644 (file)
@@ -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--;
                                }