[Pidgin] #6343: OIMs broken in msnp15 because of the wrap at 76 chars.

Pidgin trac at pidgin.im
Tue Jul 15 20:43:21 EDT 2008


#6343: OIMs broken in msnp15 because of the wrap at 76 chars.
--------------------+-------------------------------------------------------
Reporter:  Dimmuxx  |       Owner:  khc             
    Type:  defect   |      Status:  new             
Priority:  minor    |   Component:  MSN             
 Version:  2.4.3    |    Keywords:  msnp15 oim crash
 Pending:  0        |  
--------------------+-------------------------------------------------------
 Adium crashes when you send an OIM with libpurple revision
 aa1091727852b14118b50e7b20134127c4bf09d3 because of the wrapping at 76
 characters.

 This is because g_string_printf(oim_body, MSN_OIM_MSG_TEMPLATE,
 oim->run_id, oim->send_seq); is before the while loop and also len = ((len
 / 3) + 1) * 4 - 76; probably doesn't work as intended.

 I think this should work though:

 {{{
 len_mod = (len % 3) ? 1 : 0;
 len = ((len / 3) + len_mod) * 4 - 76;
 }}}

 If I fix these bugs I get an error instead when trying to send an OIM.

 {{{
 23:41:11: (Libpurple: msn) Encoding OIM Message...
 23:41:11: (Libpurple: msn) Encoded base64 body:{dGVzdA==}
 23:41:11: (Libpurple: xmlnode) XML parser error: Domain 1, code 9, level
 3: Input is not proper UTF-8, indicate encoding !
 Bytes: 0xF4 0x2D 0xD7 0x17

 23:41:11: (Libpurple: xmlnode) XML parser error: Domain 1, code 1, level
 3: internal error
 23:41:11: (Libpurple: xmlnode) XML parser error: Domain 1, code 5, level
 3: Extra content at the end of the document
 }}}

 I thought that maybe this was because of oim_body was missing at the end
 of the g_string_printf. So I added it g_string_printf(oim_body,
 MSN_OIM_MSG_TEMPLATE, oim->run_id, oim->send_seq, oim_body);

 But adding this didn't solve anything so I'm thinking that it might be
 because \n are inserted in a base64 encoded string. So maybe the string
 should be wrapped before the base64 encoding at 50 characters or something
 to ensure that it doesn't get over 76 characters before a newline.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/6343>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list