diff options
author | mav <mav@FreeBSD.org> | 2012-09-18 15:38:42 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2012-09-18 15:38:42 +0000 |
commit | 4675313369d449d3cdb513292679b7cf56812cc2 (patch) | |
tree | e73d6d9ec0f92c01df6bc22079732033c2e88ffc /sys/boot | |
parent | 74c707d4d1dddb824de2bf3fc2a108a597007bed (diff) | |
download | FreeBSD-src-4675313369d449d3cdb513292679b7cf56812cc2.zip FreeBSD-src-4675313369d449d3cdb513292679b7cf56812cc2.tar.gz |
Fix panics on attempt to dereference uninitizlized pointer, returned via
'path' argument of ofw_parsedev() if devspec refers raw device with no path.
For example, `ls /pci@1f,0/ide@d/disk@0,0:a/` works fine, while
`ls /pci@1f,0/ide@d/disk@0,0:a` panicked before this change.
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/ofw/libofw/devicename.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/boot/ofw/libofw/devicename.c b/sys/boot/ofw/libofw/devicename.c index bbacb84..c9814b7 100644 --- a/sys/boot/ofw/libofw/devicename.c +++ b/sys/boot/ofw/libofw/devicename.c @@ -105,7 +105,7 @@ ofw_parsedev(struct ofw_devdesc **dev, const char *devspec, const char **path) return(ENOENT); found: - if (path != NULL && *s != '\0') + if (path != NULL) *path = s; idev = malloc(sizeof(struct ofw_devdesc)); if (idev == NULL) { |