| Summary: | inet_ntop may set errno to ENOSPC and needs better docs | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Nick Johnson <freebsd> | ||||||
| Component: | bin | Assignee: | Bruce M Simpson <bms> | ||||||
| Status: | Closed FIXED | ||||||||
| Severity: | Affects Only Me | ||||||||
| Priority: | Normal | ||||||||
| Version: | 4.1.1-RELEASE | ||||||||
| Hardware: | Any | ||||||||
| OS: | Any | ||||||||
| Attachments: |
|
||||||||
Responsible Changed From-To: gnats-admin->freebsd-bugs Moved from pending. State Changed From-To: open->patched I'll take this. Committed to HEAD with some cleanups. Responsible Changed From-To: freebsd-bugs->bms I'll take this. Committed to HEAD with some cleanups. State Changed From-To: patched->closed -CURRENT is now -STABLE |
Instead of setting a reasonable errno, inet_ntop will set errno to ENOSPC (No space left on device) rather than something like EINVAL or ENOMEM when the destination char * is not large enough to contain the resulting address. Further, it isn't clear from the manpage if "size" is meant to be the size of the address or the max size of the destination array (it is meant to be the latter). Fix: Possible fixes to inet_ntop.c and inet.3: How-To-Repeat: inet_ntop(AF_INET, some_address, some_char_array, 5); perror("inet_ntop");