libpurple/protocols/oscar/oscar.c

branch
soc.2008.masterpassword
changeset 34106
1b0c94670bcc
parent 34103
c4785f82cb86
parent 33052
df92c3d93904
child 34108
7a07b6857540
--- a/libpurple/protocols/oscar/oscar.c	Wed Jun 13 19:33:13 2012 -0400
+++ b/libpurple/protocols/oscar/oscar.c	Wed Aug 22 18:19:53 2012 -0400
@@ -3186,10 +3186,12 @@
 			g_string_append_len(msg, last, start - last);
 		}
 
-		id = g_datalist_get_data(&attribs, "id");
+		id = g_datalist_get_data(&attribs, "src");
 
 		/* ... if it refers to a valid purple image ... */
-		if (id && (image = purple_imgstore_find_by_id(atoi(id)))) {
+		if (id
+		 && strlen(id) > (sizeof(PURPLE_STORED_IMAGE_PROTOCOL) - 1)
+		 && (image = purple_imgstore_find_by_id(atoi(id + sizeof(PURPLE_STORED_IMAGE_PROTOCOL) - 1)))) {
 			/* ... append the message from start to the tag ... */
 			unsigned long size = purple_imgstore_get_size(image);
 			const char *filename = purple_imgstore_get_filename(image);

mercurial