]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
reviewed: jinmei
authorMark Andrews <marka@isc.org>
Thu, 8 Aug 2002 04:54:30 +0000 (04:54 +0000)
committerMark Andrews <marka@isc.org>
Thu, 8 Aug 2002 04:54:30 +0000 (04:54 +0000)
1355.   [bug]           It was possible to trigger a INSIST when debugging
                        large dynamic updates. [RT #3390]

CHANGES
lib/dns/diff.c

diff --git a/CHANGES b/CHANGES
index ecb357fa1aa94dbd4f5e594293c0aff4ae285090..d2535da1b7a4b44b696ab0c05cb3a7b4b3106ad9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
 
        --- 9.2.2rc1 released ---
 
+1355.  [bug]           It was possible to trigger a INSIST when debugging
+                       large dynamic updates. [RT #3390]
+
 1354.  [bug]           nsupdate was extremely wasteful of memory.
 
 1355.  [tuning]        Reduce the number of events / quantum for zone tasks.
index b3e2bc2bed9aef644ede46ba4b80a4a50b938818..2adcf659f34dbbca13981fc861ab2608746e3503 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: diff.c,v 1.4 2001/01/09 21:50:47 bwelling Exp $ */
+/* $Id: diff.c,v 1.4.2.1 2002/08/08 04:54:30 marka Exp $ */
 
 #include <config.h>
 
@@ -488,13 +488,6 @@ dns_diff_print(dns_diff_t *diff, FILE *file) {
                result = dns_rdataset_totext(&rds, &t->name,
                                             ISC_FALSE, ISC_FALSE, &buf);
 
-               /*
-                * Get rid of final newline.
-                */
-               INSIST(buf.used >= 1 &&
-                      ((char *) buf.base)[buf.used-1] == '\n');
-               buf.used--;
-
                if (result == ISC_R_NOSPACE) {
                        isc_mem_put(diff->mctx, mem, size);
                        size += 1024;
@@ -505,22 +498,26 @@ dns_diff_print(dns_diff_t *diff, FILE *file) {
                        }
                        goto again;
                }
-               if (result == ISC_R_SUCCESS) {
-                       isc_buffer_usedregion(&buf, &r);
-                       if (file != NULL)
-                               fprintf(file, "%s %.*s\n",
-                                       t->op == DNS_DIFFOP_ADD ?
-                                       "add" : "del", (int) r.length,
-                                       (char *) r.base);
-                       else
-                               isc_log_write(DIFF_COMMON_LOGARGS,
-                                             ISC_LOG_DEBUG(7),
-                                             "%s %.*s",
-                                             t->op == DNS_DIFFOP_ADD ?
-                                             "add" : "del",
-                                             (int) r.length, (char *) r.base);
-               } else
+
+               if (result != ISC_R_SUCCESS)
                        goto cleanup;
+               /*
+                * Get rid of final newline.
+                */
+               INSIST(buf.used >= 1 &&
+                      ((char *) buf.base)[buf.used-1] == '\n');
+               buf.used--;
+
+               isc_buffer_usedregion(&buf, &r);
+               if (file != NULL)
+                       fprintf(file, "%s %.*s\n",
+                               t->op == DNS_DIFFOP_ADD ?  "add" : "del",
+                               (int) r.length, (char *) r.base);
+               else
+                       isc_log_write(DIFF_COMMON_LOGARGS, ISC_LOG_DEBUG(7),
+                                     "%s %.*s",
+                                     t->op == DNS_DIFFOP_ADD ?  "add" : "del",
+                                     (int) r.length, (char *) r.base);
        }
        result = ISC_R_SUCCESS;
  cleanup: