]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Correct authnumfreekeys accounting broken in 4.2.7p262.
authorDave Hart <hart@ntp.org>
Wed, 18 Apr 2012 19:30:28 +0000 (19:30 +0000)
committerDave Hart <hart@ntp.org>
Wed, 18 Apr 2012 19:30:28 +0000 (19:30 +0000)
bk: 4f8f1654Tp3FH8tUmtEu4Hd77GCXxQ

ChangeLog
libntp/authkeys.c

index 5083b6e78d45503c07c8fca32bda10d852a2ec05..95336de4f294f5744bc48bbea4c77c6c8bd99571 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
   reentrant when SIGIO is used.  Sanity checks relative to the prior
   get_systime() are disabled in ntpd on systems with signaled I/O, but
   active in sntp and ntpdate.
+* Correct authnumfreekeys accounting broken in 4.2.7p262.
 (4.2.7p272) 2012/04/14 Released by Harlan Stenn <stenn@ntp.org>
 * LCRYPTO is gone - replace with VER_SUFFIX.
 * Change the link order for ntpsntpd.
index d7f1fabae61e4a4eb26468f3f7dbb4056a7dad47..7b4427cd2f40932341d51c5f2b23102072d53c5a 100644 (file)
@@ -177,11 +177,11 @@ auth_moremem(
 #ifdef DEBUG
        base = sk;
 #endif
+       authnumfreekeys += i;
 
        for (; i > 0; i--, sk++) {
                LINK_SLIST(authfreekeys, sk, llink.f);
        }
-       authnumfreekeys += i;
 
 #ifdef DEBUG
        allocrec = (void *)sk;
@@ -272,7 +272,7 @@ allocsymkey(
 {
        symkey *        sk;
 
-       if (0 == authnumfreekeys)
+       if (authnumfreekeys < 1)
                auth_moremem(-1);
        UNLINK_HEAD_SLIST(sk, authfreekeys, llink.f);
        DEBUG_ENSURE(sk != NULL);