--- a/src/protocols/yahoo/yahoo.c Tue Aug 02 19:11:04 2005 -0400
+++ b/src/protocols/yahoo/yahoo.c Wed Aug 03 20:57:44 2005 -0400
@@ -2525,17 +2525,28 @@
char name[64], value[64];
- int count = sizeof(name)-1;
- while ((c < (buf + len)) && (c = strstr(c, "<input "))) {
- c = strstr(c, "name=\"") + strlen("name=\"");
- for (d = name; *c!='"' && count; c++, d++, count--)
+ int input_len = strlen("<input "); + int name_len = strlen("name=\""); + int value_len = strlen("value=\""); + while ((len > ((c - buf) + input_len)) + && (c = strstr(c, "<input "))) { + if (!(c = g_strstr_len(c, len - (c - buf), "name=\""))) + count = sizeof(name)-1; + for (d = name; (len > ((c - buf) + 1)) && *c!='"' + && count; c++, d++, count--) - d = strstr(c, "value=\"") + strlen("value=\"");
+ if (!(d = g_strstr_len(c, len - (c - buf), "value=\""))) - for (c = d, d = value; *c!='"' && count; c++, d++, count--)
+ for (c = d, d = value; (len > ((c - buf) + 1)) + && *c!='"' && count; c++, d++, count--) g_hash_table_insert(hash, g_strdup(name), g_strdup(value));