diff src/gtkimhtml.c @ 3010:11827e3d714c

[gaim-migrate @ 3023] Fixed a parsing bug regarding IM images. This was most notable when trying to view images in the log viewer (you aren't able to... does anyone want an option to?) committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 05 Mar 2002 18:19:18 +0000
parents 206bf0e4d560
children 200b8133616a
line wrap: on
line diff
--- a/src/gtkimhtml.c	Tue Mar 05 17:31:06 2002 +0000
+++ b/src/gtkimhtml.c	Tue Mar 05 18:19:18 2002 +0000
@@ -3379,6 +3379,8 @@
 						alltext++;
 					alltext = alltext + strlen("<DATA ID=\"\" SIZE=\"\">") + strlen(id) + strlen(datasize);
 					g_free(tmp);
+					if (atoi(datasize) > len - pos)
+						break;
 					imagedata = g_malloc(atoi(datasize));
 					memcpy(imagedata, alltext, atoi(datasize));