Module Name:    src
Committed By:   haad
Date:           Mon Mar 30 07:42:52 UTC 2009

Modified Files:
        src/common/lib/libprop: prop_object.c

Log Message:
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.25 -r1.26 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.25 src/common/lib/libprop/prop_object.c:1.26
--- src/common/lib/libprop/prop_object.c:1.25	Sun Jan 25 14:22:52 2009
+++ src/common/lib/libprop/prop_object.c	Mon Mar 30 07:42:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_object.c,v 1.25 2009/01/25 14:22:52 lukem Exp $	*/
+/*	$NetBSD: prop_object.c,v 1.26 2009/03/30 07:42:51 haad Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -627,7 +627,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