Mercurial > pidgin
diff libpurple/protocols/jabber/auth_digest_md5.c @ 31177:53096ba34fe6
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.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Wed, 02 Feb 2011 05:51:09 +0000 |
parents | e743507b3767 |
children |
line wrap: on
line diff
--- 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); }