Print this page
10324 topo_usb_parse_port_type() gets value check wrong
*** 288,298 ****
VERIFY3S(parse->tp_state, ==, TOPO_USB_P_PORT_TYPE);
errno = 0;
val = strtoul(line, &eptr, 0);
! if (errno != 0 || *eptr != '\0' || val > UINT_MAX) {
topo_mod_dprintf(mod, "encountered bad value for port-type "
"line: %s", line);
return (B_FALSE);
}
--- 288,298 ----
VERIFY3S(parse->tp_state, ==, TOPO_USB_P_PORT_TYPE);
errno = 0;
val = strtoul(line, &eptr, 0);
! if (errno != 0 || *eptr != '\0' || val >= UINT_MAX) {
topo_mod_dprintf(mod, "encountered bad value for port-type "
"line: %s", line);
return (B_FALSE);
}