]> 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:25:30 +0000 (22:25 +0000)
committerMark Andrews <marka@isc.org>
Thu, 24 Sep 2009 22:25:30 +0000 (22:25 +0000)
CHANGES
lib/dns/dst_api.c

diff --git a/CHANGES b/CHANGES
index 2c7f387cbe229bc622dee5d55280adbce9c57d96..ec7d2da7e7fec6966403048133583a6448d228d9 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 022caeba12df9e99cdcce62cdec31eaa742db785..84aa747d7c031a1cc2a6a14fcb465b0078bfa167 100644 (file)
@@ -18,7 +18,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.1.6.13 2009/07/29 23:56:27 each Exp $
+ * $Id: dst_api.c,v 1.1.6.14 2009/09/24 22:25:30 marka Exp $
  */
 
 /*! \file */
@@ -1223,6 +1223,8 @@ addsuffix(char *filename, unsigned int len, const char *ofilename,
 
        n = snprintf(filename, len, "%.*s%s", olen, ofilename, suffix);
        if (n < 0)
+               return (ISC_R_FAILURE);
+       if (n >= len)
                return (ISC_R_NOSPACE);
        return (ISC_R_SUCCESS);
 }