From: Michal Kazior Date: Wed, 25 Sep 2019 12:03:13 +0000 (+0200) Subject: udhcpc: fix segmentation fault on empty bin opt X-Git-Tag: 1_32_0~144 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1f1988d5256c9705a4f296ed48cdb7e463525ba4;p=oweals%2Fbusybox.git udhcpc: fix segmentation fault on empty bin opt The following caused udhcpc to segfault: busybox udhcpc -i lo -s /dev/null -x 0x3d: function old new delta udhcp_str2optset 629 641 +12 Signed-off-by: Michal Kazior Signed-off-by: Denys Vlasenko --- diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c index 4a452cdb9..9ec752dfc 100644 --- a/networking/udhcp/common.c +++ b/networking/udhcp/common.c @@ -539,7 +539,7 @@ int FAST_FUNC udhcp_str2optset(const char *const_str, void *arg, if (optflag->flags == OPTION_BIN) { val = strtok(NULL, ""); /* do not split "'q w e'" */ - trim(val); + if (val) trim(val); } else val = strtok(NULL, ", \t"); if (!val)