comparison libpurple/protocols/oscar/family_icbm.c @ 29984:6d96bfe048bc

If we get an error SNAC on the ICBM family and it's missing buddy name then don't fallthrough to the default error handler in misc.c. This was causing purple_parse_msgerr() in oscar.c to get called with different va_args than it was expecting, which caused a crash. Specifically when trying to fetch the ICQ x-status of an offline buddy. Fixes #11863. This is nosnilmot's patch, I believe. I had no part in it, other than verifying that I do believe it'll fix the crash.
author Mark Doliner <mark@kingant.net>
date Thu, 20 May 2010 01:39:25 +0000
parents 815bd8b41638
children c1b8e619f1b8
comparison
equal deleted inserted replaced
29983:7ba6fc1762dc 29984:6d96bfe048bc
164 char *bn; 164 char *bn;
165 GSList *tlvlist; 165 GSList *tlvlist;
166 166
167 if (!(snac2 = aim_remsnac(od, snac->id))) { 167 if (!(snac2 = aim_remsnac(od, snac->id))) {
168 purple_debug_misc("oscar", "icbm error: received response from unknown request!\n"); 168 purple_debug_misc("oscar", "icbm error: received response from unknown request!\n");
169 return 0; 169 return 1;
170 } 170 }
171 171
172 if (snac2->family != SNAC_FAMILY_ICBM) { 172 if (snac2->family != SNAC_FAMILY_ICBM) {
173 purple_debug_misc("oscar", "icbm error: received response from invalid request! %d\n", snac2->family); 173 purple_debug_misc("oscar", "icbm error: received response from invalid request! %d\n", snac2->family);
174 g_free(snac2->data); 174 g_free(snac2->data);
175 g_free(snac2); 175 g_free(snac2);
176 return 0; 176 return 1;
177 } 177 }
178 178
179 if (!(bn = snac2->data)) { 179 if (!(bn = snac2->data)) {
180 purple_debug_misc("oscar", "icbm error: received response from request without a buddy name!\n"); 180 purple_debug_misc("oscar", "icbm error: received response from request without a buddy name!\n");
181 g_free(snac2); 181 g_free(snac2);
182 return 0; 182 return 1;
183 } 183 }
184 184
185 reason = byte_stream_get16(bs); 185 reason = byte_stream_get16(bs);
186 186
187 tlvlist = aim_tlvlist_read(bs); 187 tlvlist = aim_tlvlist_read(bs);