]> 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:08:02 +0000 (04:08 +0000)
committerMark Andrews <marka@isc.org>
Mon, 18 Oct 2010 04:08:02 +0000 (04:08 +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 1fdd09756cd4808dd1e53c634f814eee9d889cea..a8eebdf81ca01d44e8047753750fa017acf28894 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+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.4-ESV-R3 released ---
 
 2925.  [bug]           Named failed to accept uncachable negative responses
index 191ad24a664f320a21988ffd24271400cb5b5f10..f5f95a0206763f3015516f0837caf4754a524bfd 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: print.c,v 1.27.18.5 2008/02/18 23:46:01 tbox Exp $ */
+/* $Id: print.c,v 1.27.18.6 2010/10/18 04:08:02 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--;
                                }