[Bug 193235] New: basename(3) potentially failing with ENOMEM, etc is not documented

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Sep 2 01:18:15 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193235

            Bug ID: 193235
           Summary: basename(3) potentially failing with ENOMEM, etc is
                    not documented
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: Documentation
          Assignee: freebsd-doc at FreeBSD.org
          Reporter: ngie at FreeBSD.org

basename(3) creates a static buffer for storing paths. This libcall can fail if
malloc fails however, and this potential failure isn't documented in the
manage:

68 char *
69 basename(const char *path)
70 {
71         static char *bname = NULL;
72 
73         if (bname == NULL) {
74                 bname = (char *)malloc(MAXPATHLEN);
75                 if (bname == NULL)
76                         return (NULL);
77         }

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-doc mailing list