]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Tue, 6 Nov 2001 20:42:01 +0000 (20:42 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 6 Nov 2001 20:42:01 +0000 (20:42 +0000)
1106.   [bug]           After seeing an out of range TTL, nsupdate would
                        treat all TTLs as out of range. [RT #2001]

CHANGES
bin/nsupdate/nsupdate.c

diff --git a/CHANGES b/CHANGES
index 28e053e5733b30c350c035db7f9af29ca85abd65..04497e283586bad7f0843b1a0cd52a8f0407ecc5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+1106.  [bug]           After seeing an out of range TTL, nsupdate would
+                       treat all TTLs as out of range. [RT #2001]
 
        --- 9.2.0rc9 released ---
 
index 467bb57936e6b7ddc6a7d4c28243109131d1830e..0f41a63143bc0649457fe3bbe14077c110ac762f 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.103.2.4 2001/10/15 20:25:57 gson Exp $ */
+/* $Id: nsupdate.c,v 1.103.2.5 2001/11/06 20:42:01 gson Exp $ */
 
 #include <config.h>
 
@@ -1146,6 +1146,7 @@ update_addordelete(char *cmdline, isc_boolean_t isdelete) {
                        goto doneparsing;
                }
        }
+       errno = 0;
        ttl = strtol(word, &endp, 0);
        if (*endp != '\0') {
                if (isdelete) {
@@ -1159,7 +1160,9 @@ update_addordelete(char *cmdline, isc_boolean_t isdelete) {
 
        if (isdelete)
                ttl = 0;
-       else if (ttl < 0 || ttl > TTL_MAX || errno == ERANGE) {
+       else if (ttl < 0 || ttl > TTL_MAX ||
+                (ttl == LONG_MAX && errno == ERANGE))
+       {
                /*
                 * The errno test is needed to catch when strtol()
                 * overflows on a platform where sizeof(int) ==