| Summary: | dirname.c basename.c not correctly return ENAMETOOLONG | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | davidx <davidx> | ||||
| Component: | bin | Assignee: | dd <dd> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Unspecified | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
State Changed From-To: open->analyzed Fixed but slightly differently, thanks! Responsible Changed From-To: freebsd-bugs->dd My MFC reminder. State Changed From-To: analyzed->closed MFC'd, thanks. |
libc function basename and dirname missing a condition to return ENAMETOOLONG Fix: - if (endp - path + 1 >= sizeof(bname)) { + if (endp - path + 1 > sizeof(bname)) { errno = ENAMETOOLONG; return(NULL); } - if (endp - startp + 1 >= sizeof(bname)) { + if (endp - startp + 1 > sizeof(bname)) { errno = ENAMETOOLONG; return(NULL); }--4ZrvMB36GQvFmOv6DSdEfDzZgddn5cMUPukm289VIjnFYoSt Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- dirname.c Thu Jun 28 14:28:37 2001 +++ dirname.c.orig Thu Jun 28 14:28:25 2001 @@ -69,7 +69,7 @@ } while (endp > path && *endp == '/'); }