bin/71743: off-by-one error in mkdir

Brian Moore mooreb at
Tue Sep 14 12:50:21 PDT 2004

>Number:         71743
>Category:       bin
>Synopsis:       off-by-one error in mkdir
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 14 19:50:20 GMT 2004
>Originator:     Brian Moore
>Release:        4.9
Silver Spring Networks
FreeBSD 4.9-RELEASE FreeBSD 4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003     root at  i386

mkdir experiences a uninitialized memory read when building a directory
that does not end in a slash.
with purify, pass mkdir a path that does not end in a slash.
you will see a UMR.

the following patch is to src/bin/mkdir/mkdir.c:

<     if ('\0' == p[1]) {
>     if (last || ('\0' == p[1])) {


More information about the freebsd-bugs mailing list