diff options
author | Alexander Motin <mav@FreeBSD.org> | 2012-09-18 15:38:42 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2012-09-18 15:38:42 +0000 |
commit | 1123f298f35ebee2f6da4d4b36ce1c6bd6493de1 (patch) | |
tree | e73d6d9ec0f92c01df6bc22079732033c2e88ffc /sys/boot/ofw/libofw/devicename.c | |
parent | e67c0426bc0eddf0fe98a9c299d1daa540eaf9e3 (diff) | |
download | src-test2-1123f298f35ebee2f6da4d4b36ce1c6bd6493de1.tar.gz src-test2-1123f298f35ebee2f6da4d4b36ce1c6bd6493de1.zip |
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.
Notes
Notes:
svn path=/head/; revision=240655
Diffstat (limited to 'sys/boot/ofw/libofw/devicename.c')
-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 bbacb84c454e..c9814b76e97a 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) { |