]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1355. [bug] It was possible to trigger a INSIST when debugging
authorMark Andrews <marka@isc.org>
Tue, 6 Aug 2002 14:33:08 +0000 (14:33 +0000)
committerMark Andrews <marka@isc.org>
Tue, 6 Aug 2002 14:33:08 +0000 (14:33 +0000)
                        large dynamic updates. [RT #3390]

CHANGES
lib/dns/diff.c

diff --git a/CHANGES b/CHANGES
index 4a69f350b4824e17de7c75e4b5e3d7162fc0253e..b59b1609fc77419f5fc672eb42e58993187f8e2e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+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 76285d7efaaa0d0c72263b8bdddf11db06372841..6cb4a6ad34306ed163d85d116953c03e873dcc58 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: diff.c,v 1.5 2001/11/29 00:15:34 gson Exp $ */
+/* $Id: diff.c,v 1.6 2002/08/06 14:33:08 marka Exp $ */
 
 #include <config.h>
 
@@ -499,13 +499,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;
@@ -516,22 +509,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: