From: Denys Vlasenko Date: Sat, 24 Nov 2018 23:42:56 +0000 (+0100) Subject: ntpd: do not SEGV on "-p keyno:192.168.1.1", show --help instead X-Git-Tag: 1_30_0~375 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0d18e5cab2159b55cb56962711d428246c197929;p=oweals%2Fbusybox.git ntpd: do not SEGV on "-p keyno:192.168.1.1", show --help instead Signed-off-by: Denys Vlasenko --- diff --git a/networking/ntpd.c b/networking/ntpd.c index 4f8607244..041cac762 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -2539,6 +2539,7 @@ static NOINLINE void ntp_init(char **argv) int key_id; peer += 6; end = strchr(peer, ':'); + if (!end) bb_show_usage(); *end = '\0'; key_id = xatou_range(peer, 1, MAX_KEY_NUMBER); *end = ':';