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

diff --git a/CHANGES b/CHANGES
index 42ff6b93d55aceb9b03e70c58f19a8d39409dc77..78a0504b1e36cadfe220f366b9e7cd59b5d4561e 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 31bac793613c230214a0f26fd8eb4b563ed5c9af..40d997849bd84695d9bdd5e8500fffe712993cb8 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.11.92.7 2009/07/29 23:55:00 each Exp $
+ * $Id: dst_api.c,v 1.11.92.8 2009/09/24 22:22:22 marka Exp $
  */
 
 /*! \file */
@@ -1247,6 +1247,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);
 }