aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp
diff options
context:
space:
mode:
authorMichal Kazior <michal@plume.com>2019-09-25 14:03:13 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2019-10-08 15:14:46 +0200
commit1f1988d5256c9705a4f296ed48cdb7e463525ba4 (patch)
tree929b37d9ed9f45ea27de2ed4da036d74c5dc7ce6 /networking/udhcp
parent6c1af283f73fb8640cd7273c2bf13eb102f80954 (diff)
downloadbusybox-1f1988d5256c9705a4f296ed48cdb7e463525ba4.tar.gz
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 <michal@plume.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp')
-rw-r--r--networking/udhcp/common.c2
1 files changed, 1 insertions, 1 deletions
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)