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:
parent
5084bae61a
commit
0d18e5cab2
@ -2539,6 +2539,7 @@ static NOINLINE void ntp_init(char **argv)
|
|||||||
int key_id;
|
int key_id;
|
||||||
peer += 6;
|
peer += 6;
|
||||||
end = strchr(peer, ':');
|
end = strchr(peer, ':');
|
||||||
|
if (!end) bb_show_usage();
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
key_id = xatou_range(peer, 1, MAX_KEY_NUMBER);
|
key_id = xatou_range(peer, 1, MAX_KEY_NUMBER);
|
||||||
*end = ':';
|
*end = ':';
|
||||||
|
Loading…
Reference in New Issue
Block a user