Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Sep 2014 01:18:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-doc@FreeBSD.org
Subject:   [Bug 193235] New: basename(3) potentially failing with ENOMEM, etc is not documented
Message-ID:  <bug-193235-9@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org
          Reporter: ngie@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-193235-9>