Module Name: src Committed By: sborrill Date: Sat Oct 10 18:16:25 UTC 2009
Modified Files: src/usr.sbin/acpitools/aml [netbsd-5]: aml_name.c Log Message: Pull up the following revisions(s) (requested by cegger in ticket #1078): usr.sbin/acpitools/aml/aml_name.c: revision 1.4 Check validity of parent and so fix potential segfault. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.10.1 src/usr.sbin/acpitools/aml/aml_name.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/acpitools/aml/aml_name.c diff -u src/usr.sbin/acpitools/aml/aml_name.c:1.3 src/usr.sbin/acpitools/aml/aml_name.c:1.3.10.1 --- src/usr.sbin/acpitools/aml/aml_name.c:1.3 Tue Jan 15 19:08:00 2008 +++ src/usr.sbin/acpitools/aml/aml_name.c Sat Oct 10 18:16:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: aml_name.c,v 1.3 2008/01/15 19:08:00 jmcneill Exp $ */ +/* $NetBSD: aml_name.c,v 1.3.10.1 2009/10/10 18:16:25 sborrill Exp $ */ /*- * Copyright (c) 1999 Takanori Watanabe @@ -31,7 +31,7 @@ * $FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_name.c,v 1.3 2000/11/09 06:24:45 iwasaki Exp $ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: aml_name.c,v 1.3 2008/01/15 19:08:00 jmcneill Exp $"); +__RCSID("$NetBSD: aml_name.c,v 1.3.10.1 2009/10/10 18:16:25 sborrill Exp $"); #include <sys/param.h> @@ -283,11 +283,12 @@ newname->parent = parent; newname->child = NULL; newname->property = NULL; - if (parent->child) + if (parent && parent->child) newname->brother = parent->child; else newname->brother = NULL; - parent->child = newname; + if (parent) + parent->child = newname; newname->chain = name_group_list->head; name_group_list->head = newname;