From: Harlan Stenn Date: Sun, 26 Apr 2015 08:14:52 +0000 (+0000) Subject: CID 1295478: Quiet a pedantic potential error from the fix for Bug 2776 X-Git-Tag: NTP_4_3_20~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59d7bc5181cbe59477c0d79ac5d1a64777775045;p=thirdparty%2Fntp.git CID 1295478: Quiet a pedantic potential error from the fix for Bug 2776 bk: 553c9e7cYAJvwLeprBkc6xWM4MOpTA --- diff --git a/ChangeLog b/ChangeLog index 7899a2f26..8814f355b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --- +* CID 1295478: Quiet a pedantic potential error from the fix for Bug 2776. * [Bug 2776] Improve ntpq's 'help keytype'. * [Bug 2794] Clean up kernel clock status reports. * [Bug 2800] refclock_true.c true_debug() can't open debug log because @@ -9,6 +10,7 @@ Various improvements, see http://bugs.ntp.org/2808 for details. Changed libjsmn to a more recent version. * Improve the ntpq documentation around the controlkey keyid. +* ntpq.c cleanup. --- (4.2.8p2) 2015/04/07 Released by Harlan Stenn (4.2.8p2-RC3) 2015/04/03 Released by Harlan Stenn diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 2cece7eb7..af5f6815c 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -21,6 +21,7 @@ #include #include "ntpq.h" +#include "ntp_assert.h" #include "ntp_stdlib.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" @@ -219,8 +220,10 @@ static int assoccmp (const void *, const void *); void ntpq_custom_opt_handler (tOptions *, tOptDesc *); #ifdef OPENSSL +# ifdef HAVE_EVP_MD_DO_ALL_SORTED static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void *arg ); +# endif #endif static char *list_digest_names(void); @@ -475,6 +478,10 @@ ntpqmain( break; } + /* CID: 1295478 */ + /* This should only "trip" if "keytype" is removed from builtins */ + INSIST(icmd < sizeof(builtins)/sizeof(builtins[0])); + #ifdef OPENSSL builtins[icmd].desc[0] = "digest-name"; fmt = "set key type to use for authenticated requests, one of:%s"; @@ -3459,6 +3466,7 @@ ntpq_custom_opt_handler( */ #ifdef OPENSSL +# ifdef HAVE_EVP_MD_DO_ALL_SORTED struct hstate { char *list; const char **seen; @@ -3526,6 +3534,7 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void * else hstate->idx++; } +# endif #endif static char *list_digest_names(void)