ntpd: do not SEGV on "-p keyno:192.168.1.1", show --help instead

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-11-25 00:42:56 +01:00
parent 5084bae61a
commit 0d18e5cab2

View File

@ -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 = ':';