diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-12-08 16:41:05 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-12-08 16:41:05 +0100 |
commit | 7280d2017d8075267a12e469983e38277dcf0374 (patch) | |
tree | 3a6bd5c562b04dfadeb72ba7f599db66026977f1 /networking/udhcp/common.h | |
parent | 53782d9221c854be057edfc4e847ea13717dfece (diff) | |
download | busybox-w32-7280d2017d8075267a12e469983e38277dcf0374.tar.gz busybox-w32-7280d2017d8075267a12e469983e38277dcf0374.tar.bz2 busybox-w32-7280d2017d8075267a12e469983e38277dcf0374.zip |
udhcpc: sanitize hostnames in incoming packets. Closes 3979.
The following options are replaced with string "bad" if they
contain malformed hostname:
HOST_NAME, DOMAIN_NAME, NIS_DOMAIN, TFTP_SERVER_NAME
function old new delta
xmalloc_optname_optval 850 888 +38
attach_option 440 443 +3
len_of_option_as_string 13 14 +1
dhcp_option_lengths 13 14 +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 43/0) Total: 43 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r-- | networking/udhcp/common.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index 479ae49f3..cfd58679a 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h | |||
@@ -80,6 +80,9 @@ enum { | |||
80 | OPTION_IP = 1, | 80 | OPTION_IP = 1, |
81 | OPTION_IP_PAIR, | 81 | OPTION_IP_PAIR, |
82 | OPTION_STRING, | 82 | OPTION_STRING, |
83 | /* Opts of STRING_HOST type will be sanitized before they are passed | ||
84 | * to udhcpc script's environment: */ | ||
85 | OPTION_STRING_HOST, | ||
83 | // OPTION_BOOLEAN, | 86 | // OPTION_BOOLEAN, |
84 | OPTION_U8, | 87 | OPTION_U8, |
85 | OPTION_U16, | 88 | OPTION_U16, |