# HG changeset patch # User Paul Aurich # Date 1296625869 0 # Node ID 53096ba34fe6a541727fe3c47a5c8557b5aad380 # Parent e743507b376765f3e044b526a32bdb9356d27c07 jabber: Properly parse realm="" in DIGEST-MD5, which is apparently valid. On a marginally related note, the ABNF in this RFC is really ugly. Refs #a14514. diff -r e743507b3767 -r 53096ba34fe6 ChangeLog --- a/ChangeLog Wed Feb 02 05:47:50 2011 +0000 +++ b/ChangeLog Wed Feb 02 05:51:09 2011 +0000 @@ -58,6 +58,8 @@ (Nikita Kozlov) (#13136) * Handle Connection: Close headers for BOSH, when the server does not terminate the connection itself. (#13008) + * Improved parsing for DIGEST-MD5, which should resolve issues + connecting to some jabberd2 servers. (#a14514) Yahoo!/Yahoo! JAPAN: * Fix a crash when an account disconnects before a p2p session is diff -r e743507b3767 -r 53096ba34fe6 libpurple/protocols/jabber/auth_digest_md5.c --- a/libpurple/protocols/jabber/auth_digest_md5.c Wed Feb 02 05:47:50 2011 +0000 +++ b/libpurple/protocols/jabber/auth_digest_md5.c Wed Feb 02 05:51:09 2011 +0000 @@ -78,12 +78,12 @@ val_start++; val_end = cur; - while (val_end != val_start && (*val_end == ' ' || *val_end == ',' || *val_end == '\t' + while (val_end >= val_start && (*val_end == ' ' || *val_end == ',' || *val_end == '\t' || *val_end == '\r' || *val_end == '\n' || *val_end == '"' || *val_end == '\0')) val_end--; - if (val_start != val_end) + if (val_end - val_start + 1 >= 0) value = g_strndup(val_start, val_end - val_start + 1); }