mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-29 12:50:47 +00:00
4388c38468faa5794e54f29364ae8b20426f9180
lookup_dhcp_len() returns the flag word from the option table, so since1af6ee6468an option carrying OT_DHCP6_VENDOR yields an opt_len of 0x0100. --dhcp-option=option6:vendor-class,343 has a purely decimal argument list and therefore takes the is_dec branch, which comes long before the new OT_DHCP6_VENDOR branch, and if (opt_len != 0) new->len = opt_len; sets new->len to 256. The value is then written by shifting an int by up to 2040 bits, which is undefined behavior, and a 256-byte vendor-class option ends up on the wire: $ dnsmasq --test --dhcp-option=option6:vendor-class,343 option.c:1715:23: runtime error: shift exponent 2040 is too large for 32-bit type 'int' dnsmasq: syntax check OK. The numeric spelling option6:16,343 takes the same path. Before1af6ee6both were rejected, as vendor-class was OT_INTERNAL back then. Keep the is_dec branch away from OT_DHCP6_VENDOR, so the dedicated parser runs and reports the missing vendor class instead. Signed-off-by: DL6ER <dl6er@dl6er.de>
Languages
C
94.3%
Perl
2.2%
HTML
1.2%
Shell
1%
Makefile
0.6%
Other
0.6%