udhcpc: sanitize hostnames in incoming packets. Closes 3979.
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Dec 2011 15:41:05 +0000 (16:41 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Dec 2011 15:41:05 +0000 (16:41 +0100)
commit7280d2017d8075267a12e469983e38277dcf0374
tree3a6bd5c562b04dfadeb72ba7f599db66026977f1
parent53782d9221c854be057edfc4e847ea13717dfece
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>
networking/udhcp/common.c
networking/udhcp/common.h
networking/udhcp/dhcpc.c