changeset 11705:0906a3e9626c

[gaim-migrate @ 13996] Protect against a size variable overflow in xmlnode_from_str. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 21 Oct 2005 19:03:34 +0000
parents 96a9462583c1
children bcc49c25ef90
files src/xmlnode.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmlnode.c	Thu Oct 20 21:21:49 2005 +0000
+++ b/src/xmlnode.c	Fri Oct 21 19:03:34 2005 +0000
@@ -412,7 +412,7 @@
 
 	g_return_val_if_fail(str != NULL, NULL);
 
-	real_size = size == -1 ? strlen(str) : size;
+	real_size = size < 0 ? strlen(str) : size;
 	xpd = g_new0(struct _xmlnode_parser_data, 1);
 	context = g_markup_parse_context_new(&xmlnode_parser, 0, xpd, NULL);