summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Decotigny2018-05-24 08:30:16 -0700
committerDenys Vlasenko2018-05-24 18:26:01 +0200
commita174c791ece5d7f2869e9efd338d91c8ea10f609 (patch)
tree7aaacf8f1e63c1edeebe5ccce28deccec6a7f6a1
parent747162109fb1c891baf6aafa1ca0410bd08d04a4 (diff)
downloadbusybox-a174c791ece5d7f2869e9efd338d91c8ea10f609.zip
busybox-a174c791ece5d7f2869e9efd338d91c8ea10f609.tar.gz
udhcpc6: ignore invalid OPTION_IAADDR
Signed-off-by: David Decotigny <ddecotig@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/udhcp/d6_dhcpc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index 9e3ce8b..2ff9c56 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -287,6 +287,10 @@ static void option_to_env(uint8_t *option, uint8_t *option_end)
* | valid-lifetime |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
+ /* Make sure payload contains an address */
+ if (option[3] < 24)
+ break;
+
sprint_nip6(ipv6str, option + 4);
*new_env() = xasprintf("ipv6=%s", ipv6str);