# HG changeset patch # User Daniel Atallah # Date 1123117681 0 # Node ID 12fc7a3fbc88ad64e6fb6bca8be8f956c77a22d1 # Parent 744c0708d11f0b0a64ba0d9de100b6f6c147c1dc [gaim-migrate @ 13305] It'll be nice not to crash when logging in with the wrong password. committer: Tailor Script diff -r 744c0708d11f -r 12fc7a3fbc88 src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Wed Aug 03 23:54:37 2005 +0000 +++ b/src/protocols/yahoo/yahoo.c Thu Aug 04 01:08:01 2005 +0000 @@ -2300,17 +2300,28 @@ const char *c = buf; char *d; char name[64], value[64]; - int count = sizeof(name)-1; - while ((c < (buf + len)) && (c = strstr(c, " ((c - buf) + input_len)) + && (c = strstr(c, " ((c - buf) + 1)) && *c!='"' + && count; c++, d++, count--) *d = *c; *d = '\0'; count = sizeof(value)-1; - d = strstr(c, "value=\"") + strlen("value=\""); + if (!(d = g_strstr_len(c, len - (c - buf), "value=\""))) + continue; + d += value_len; if (strchr(c, '>') < d) break; - for (c = d, d = value; *c!='"' && count; c++, d++, count--) + for (c = d, d = value; (len > ((c - buf) + 1)) + && *c!='"' && count; c++, d++, count--) *d = *c; *d = '\0'; g_hash_table_insert(hash, g_strdup(name), g_strdup(value));