Fix a crash on receiving a file with no preview that I just introduced

Sun, 19 Dec 2010 20:30:38 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 19 Dec 2010 20:30:38 +0000
changeset 31258
1ce5b83274c1
parent 31256
4e5c5d9d8b3d
child 31259
9c8140bf3c63

Fix a crash on receiving a file with no preview that I just introduced
with the new functions. The preview pointer/size was left
uninitialized if there wasn't one.

libpurple/protocols/msn/xfer.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/msn/xfer.c	Sun Dec 19 18:37:10 2010 +0000
+++ b/libpurple/protocols/msn/xfer.c	Sun Dec 19 20:30:38 2010 +0000
@@ -225,6 +225,9 @@
 	if (header->type == 0 && len > header->length) {
 		header->preview_len = len - header->length;
 		header->preview = g_memdup(buf, header->preview_len);
+	} else {
+		header->preview_len = 0;
+		header->preview = NULL;
 	}
 
 	return header;

mercurial