]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 1295478: Quiet a pedantic potential error from the fix for Bug 2776
authorHarlan Stenn <stenn@ntp.org>
Sun, 26 Apr 2015 08:14:52 +0000 (08:14 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sun, 26 Apr 2015 08:14:52 +0000 (08:14 +0000)
bk: 553c9e7cYAJvwLeprBkc6xWM4MOpTA

ChangeLog
ntpq/ntpq.c

index 7899a2f26f4b8253067583636f74325e33c8f4da..8814f355bfd233d4a4ff7a5419ce0a46407e92ec 100644 (file)
--- 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 <stenn@ntp.org>
 (4.2.8p2-RC3) 2015/04/03 Released by Harlan Stenn <stenn@ntp.org>
index 2cece7eb7f1930564d94d9ae4d16bfa0e902fda1..af5f6815c4f834a58096d760e7f79f09b1cbdc20 100644 (file)
@@ -21,6 +21,7 @@
 #include <isc/result.h>
 
 #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)