summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2018-11-25 00:42:56 +0100
committerDenys Vlasenko2018-11-25 00:42:56 +0100
commit0d18e5cab2159b55cb56962711d428246c197929 (patch)
treedc8a1a9ad5aaa24cdc097877a056fcb29aec24a7
parent5084bae61aac86fc6d13d48e59f5b98908de7d31 (diff)
downloadbusybox-0d18e5cab2159b55cb56962711d428246c197929.zip
busybox-0d18e5cab2159b55cb56962711d428246c197929.tar.gz
ntpd: do not SEGV on "-p keyno:192.168.1.1", show --help instead
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ntpd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 4f86072..041cac7 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 = ':';