]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2689. [bug] Correctly handle snprintf result. [RT #20306]
authorMark Andrews <marka@isc.org>
Thu, 24 Sep 2009 22:19:08 +0000 (22:19 +0000)
committerMark Andrews <marka@isc.org>
Thu, 24 Sep 2009 22:19:08 +0000 (22:19 +0000)
CHANGES
lib/dns/dst_api.c

diff --git a/CHANGES b/CHANGES
index 0ccb81cee4b9f85f7d05e9c057d4e91ee40dd1f0..fc119fd13c26858884601f6c32e650c6c600ffa1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2689.  [bug]           Correctly handle snprintf result. [RT #20306]
+
 2688.  [bug]           Use INTERFACE_F_POINTTOPOINT, not IFF_POINTOPOINT,
                        to decide to fetch the destination address. [RT #20305]
 
index 22a95f89755a1894fb349f77bddd05d9f4b43366..70c1fe323e415b3ce5a71a3d4161e19f2fadaa1c 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.31 2009/09/23 16:01:57 each Exp $
+ * $Id: dst_api.c,v 1.32 2009/09/24 22:19:08 marka Exp $
  */
 
 /*! \file */
@@ -1508,6 +1508,8 @@ addsuffix(char *filename, unsigned int len, const char *odirname,
                n = snprintf(filename, len, "%s/%.*s%s",
                             odirname, olen, ofilename, suffix);
        if (n < 0)
+               return (ISC_R_FAILURE);
+       if (n >= len)
                return (ISC_R_NOSPACE);
        return (ISC_R_SUCCESS);
 }