--- 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);