Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2012 15:38:42 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240655 - head/sys/boot/ofw/libofw
Message-ID:  <201209181538.q8IFcguO018335@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Sep 18 15:38:42 2012
New Revision: 240655
URL: http://svn.freebsd.org/changeset/base/240655

Log:
  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.

Modified:
  head/sys/boot/ofw/libofw/devicename.c

Modified: head/sys/boot/ofw/libofw/devicename.c
==============================================================================
--- head/sys/boot/ofw/libofw/devicename.c	Tue Sep 18 14:33:27 2012	(r240654)
+++ head/sys/boot/ofw/libofw/devicename.c	Tue Sep 18 15:38:42 2012	(r240655)
@@ -105,7 +105,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c
     return(ENOENT);
 
 found:
-    if (path != NULL && *s != '\0')
+    if (path != NULL)
 	*path = s;
     idev = malloc(sizeof(struct ofw_devdesc));
     if (idev == NULL) {



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