From: Dave Hart Date: Wed, 18 Apr 2012 19:30:28 +0000 (+0000) Subject: Correct authnumfreekeys accounting broken in 4.2.7p262. X-Git-Tag: NTP_4_2_7P273~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7658c6cde0138c6f755d8b415c725a737dcb4bec;p=thirdparty%2Fntp.git Correct authnumfreekeys accounting broken in 4.2.7p262. bk: 4f8f1654Tp3FH8tUmtEu4Hd77GCXxQ --- diff --git a/ChangeLog b/ChangeLog index 5083b6e78..95336de4f 100644 --- 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 * LCRYPTO is gone - replace with VER_SUFFIX. * Change the link order for ntpsntpd. diff --git a/libntp/authkeys.c b/libntp/authkeys.c index d7f1fabae..7b4427cd2 100644 --- a/libntp/authkeys.c +++ b/libntp/authkeys.c @@ -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);