]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3898. [bug] To small a buffer in tohexstr() calls in test code.
authorMark Andrews <marka@isc.org>
Tue, 22 Jul 2014 01:26:28 +0000 (11:26 +1000)
committerMark Andrews <marka@isc.org>
Tue, 22 Jul 2014 01:26:50 +0000 (11:26 +1000)
                        [RT #36598]

(cherry picked from commit 6a6838f97363c7f3abe47e1fb116be2593bc53a5)

CHANGES
lib/dns/tests/gost_test.c
lib/isc/tests/hash_test.c

diff --git a/CHANGES b/CHANGES
index e8633e568fa1e38da873468d6b3c9a032d5e3eca..2c31688370f76ffe568c61b7b3f6f742fc4aefc5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3898.  [bug]           To small a buffer in tohexstr() calls in test code.
+                       [RT #36598]
+
 3897.  [bug]           RPZ summary information was not properly being updated
                        after a AXFR resulting in changes sometimes being
                        ignored.  [RT #35885]
index b254f60462bb9e3846057ac384377af13f431be1..d04d44552f420af59c01a7b8221cf5cbe217a7ac 100644 (file)
@@ -54,7 +54,7 @@
 unsigned char digest[ISC_GOST_DIGESTLENGTH];
 unsigned char buffer[1024];
 const char *s;
-char str[ISC_GOST_DIGESTLENGTH];
+char str[2 * ISC_GOST_DIGESTLENGTH + 1];
 int i = 0;
 
 isc_result_t
@@ -65,7 +65,7 @@ tohexstr(unsigned char *d, unsigned int len, char *out);
  * Postcondition: A String representation of the given hexadecimal number is
  *   placed into the array *out
  *
- * 'out' MUST point to an array of at least len / 2 + 1
+ * 'out' MUST point to an array of at least len * 2 + 1
  *
  * Return values: ISC_R_SUCCESS if the operation is sucessful
  */
index 5f937db03db14bd3d97195b2d66978a9d9c32230..407eff6a1b4787b94c312051fd21efec9919b9e6 100644 (file)
@@ -40,7 +40,7 @@
 unsigned char digest[ISC_SHA512_DIGESTLENGTH];
 unsigned char buffer[1024];
 const char *s;
-char str[ISC_SHA512_DIGESTLENGTH];
+char str[2 * ISC_SHA512_DIGESTLENGTH + 1];
 unsigned char key[20];
 int i = 0;
 
@@ -52,7 +52,7 @@ tohexstr(unsigned char *d, unsigned int len, char *out);
  * Postcondition: A String representation of the given hexadecimal number is
  *   placed into the array *out
  *
- * 'out' MUST point to an array of at least len / 2 + 1
+ * 'out' MUST point to an array of at least len * 2 + 1
  *
  * Return values: ISC_R_SUCCESS if the operation is sucessful
  */