diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-15 10:26:25 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-15 10:26:25 +0000 |
commit | 9fca06579d61d6360520db98092bce13d30d39ce (patch) | |
tree | 861ba7190fc44c6ca5e8973cc0f5b268de3bd8ad | |
parent | 315dd4c1566dcd4caa9c4ca0eceeceb995a01443 (diff) |
Deal with stupid (on first sight, at least) Yahoo! server behaviour causing
double free()s on testing ATM. Apparently it's perfectly legal to give buddy
information with an "end buddy" marker but no "begin buddy".
-rw-r--r-- | protocols/yahoo/libyahoo2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index 5b2ff44e..1bfc2e59 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -1343,7 +1343,11 @@ static void yahoo_process_status(struct yahoo_input_data *yid, break; case 301: /* End buddy */ if (!strcmp(pair->value, "315") && u) { - users = y_list_prepend(users, u); + /* Sometimes user info comes in an odd format with no + "begin buddy" but *with* an "end buddy". Don't add + it twice. */ + if (!y_list_find(users, u)) + users = y_list_prepend(users, u); u = yd->half_user = NULL; } break; |