changeset 4900:a70572d5a5fc

6579163 Segmentation Fault in 'prtconf -vb'
author vb160487
date Mon, 20 Aug 2007 02:05:48 -0700
parents c22ca819967b
children e5be9002831f
files usr/src/cmd/prtconf/pdevinfo.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/prtconf/pdevinfo.c	Sun Aug 19 23:34:42 2007 -0700
+++ b/usr/src/cmd/prtconf/pdevinfo.c	Mon Aug 20 02:05:48 2007 -0700
@@ -1690,12 +1690,12 @@
 	di_node_t next_node;
 	uchar_t *prop_valp;
 
-	next_node = di_child_node(parent);
-	while (next_node != DI_NODE_NIL) {
-		next_node = di_sibling_node(next_node);
-		(void) get_propval_by_name(promh, next_node, "name",
-		    &prop_valp);
-		if (strcmp((char *)prop_valp, node_name) == 0)
+	for (next_node = di_child_node(parent); next_node != DI_NODE_NIL;
+	    next_node = di_sibling_node(next_node)) {
+		int len;
+
+		len = get_propval_by_name(promh, next_node, "name", &prop_valp);
+		if ((len != -1) && (strcmp((char *)prop_valp, node_name) == 0))
 			return (next_node);
 	}
 	return (DI_NODE_NIL);