| Summary: | There is a bug in SIOCGIFCONF ioctl code | ||
|---|---|---|---|
| Product: | Base System | Reporter: | alo <alo> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
alo
2000-03-19 21:40:01 UTC
This bug is the same as described in PR kern/17311. Basically what goes wrong is that the variable "space" can be decremented too much resulting in a negative number. Then, when you do a compare between space and sizeof(xxx) to verify if there is enough room for the next interface config structure, the comparison succeeds because with the "signed" int (space) gets silently casted to an "unsigned" int, (which of course is fairly large). PR 17311 contains a more complete fix than just changing all sizeof(xxx) to (int)sizeof(xxx), which may result in incomplete structures being copied over. Patrick. State Changed From-To: open->closed Duplicate of PR 17311 http://www.FreeBSD.org/cgi/query-pr.cgi?pr=17311 |