Bug 28472

Summary: dirname.c basename.c not correctly return ENAMETOOLONG
Product: Base System Reporter: davidx <davidx>
Component: binAssignee: dd <dd>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description davidx 2001-06-28 07:40:01 UTC
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 == '/');
        }
Comment 1 dd freebsd_committer freebsd_triage 2001-06-28 22:50:57 UTC
State Changed
From-To: open->analyzed

Fixed but slightly differently, thanks! 


Comment 2 dd freebsd_committer freebsd_triage 2001-06-28 22:50:57 UTC
Responsible Changed
From-To: freebsd-bugs->dd

My MFC reminder.
Comment 3 dd freebsd_committer freebsd_triage 2001-07-23 11:13:05 UTC
State Changed
From-To: analyzed->closed

MFC'd, thanks.