]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3430] ntpq dumps core (SIGSEGV) for "keytype md2"
authorJuergen Perlinger <perlinger@ntp.org>
Thu, 7 Sep 2017 09:11:08 +0000 (11:11 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Thu, 7 Sep 2017 09:11:08 +0000 (11:11 +0200)
 - sidekick: permit longer key type (hash algo names) for SNTP

bk: 59b10d2cqSh0BkwudoW-VSPqWosyTA

sntp/crypto.c
sntp/crypto.h

index 25bdbf8db7a7be171bb17cb8d2b41a7a8de913df..1158b3cac2463e336cac1abed371c00b27e426f6 100644 (file)
@@ -139,7 +139,7 @@ auth_init(
                if (octothorpe)
                        *octothorpe = '\0';
                act = emalloc(sizeof(*act));
-               scan_cnt = sscanf(kbuf, "%d %9s %128s", &act->key_id, act->typen, keystring);
+               scan_cnt = sscanf(kbuf, "%d %19s %128s", &act->key_id, act->typen, keystring);
                if (scan_cnt == 3) {
                        int len = strlen(keystring);
                        goodline = 1;   /* assume best for now */
index 72a5a97dea0765daf135e20f3747d63ecf3b1837..961dca042a9f7f6da87ac5467731f9f92d8b6275 100644 (file)
@@ -21,7 +21,7 @@ struct key {
        int             key_id;
        int             key_len;
        int             typei;
-       char            typen[10];
+       char            typen[20];
        char            key_seq[64];
 };