Module Name:    src
Committed By:   snj
Date:           Mon Mar 30 16:33:39 UTC 2009

Modified Files:
        src/common/lib/libprop [netbsd-5]: prop_object.c

Log Message:
Pull up following revision(s) (requested by haad in ticket #623):
        common/lib/libprop/prop_object.c: revision 1.26
Fix crash where user was able to crash proplib with trying to internalize
bad xml file with non-existing data type e.g. <number>.
Problem is that poi is not NULL even in case that we haven't find any match
in data type name. We need to check if poi->poi_tag is not NULL before
calling poi->poi_intern function which is non existing case NULL and will
cause crash.


To generate a diff of this commit:
cvs rdiff -u -r1.22.4.1 -r1.22.4.2 src/common/lib/libprop/prop_object.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libprop/prop_object.c
diff -u src/common/lib/libprop/prop_object.c:1.22.4.1 src/common/lib/libprop/prop_object.c:1.22.4.2
--- src/common/lib/libprop/prop_object.c:1.22.4.1	Sun Nov 30 02:40:01 2008
+++ src/common/lib/libprop/prop_object.c	Mon Mar 30 16:33:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_object.c,v 1.22.4.1 2008/11/30 02:40:01 snj Exp $	*/
+/*	$NetBSD: prop_object.c,v 1.22.4.2 2009/03/30 16:33:39 snj Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -626,7 +626,7 @@
 						   poi->poi_taglen))
 			break;
 	}
-	if (poi == NULL) {
+	if ((poi == NULL) || (poi->poi_tag == NULL)) {
 		while (_prop_stack_pop(&stack, &obj, &iter, &data, NULL)) {
 			iter_func = (prop_object_internalizer_continue_t)iter;
 			(*iter_func)(&stack, &obj, ctx, data, NULL);

Reply via email to