dhcp_option_type_from_code() returns _DHCP_OPTION_TYPE_INVALID (-EINVAL)
for the PAD and END option codes, and dump_dhcp_option_one() uses the
returned value directly as an index into the functions[] table. Those
codes are excluded by an assert() at the top of the function, but
assert() compiles down to __builtin_unreachable() under NDEBUG, so a
negative array index read is reachable there (and trips static
analyzers). Bail out explicitly on the error return.
CID#
1660105
Follow-up for
149adb2fdce0d9a40f9332ecb1a48a486fce5194
bool fallback = false;
if (type == DHCP_OPTION_TYPE_AUTO) {
type = dhcp_option_type_from_code(code);
+ if (type < 0)
+ return type;
fallback = true;
}