diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-25 15:59:12 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-25 15:59:12 +0200 |
commit | c6bf805c65caefdc20fe3c7bcad63bf3c4660fb8 (patch) | |
tree | 2caf9e57b22acf7461ba1a5e4ee92a82a87bdc15 | |
parent | 51a3d12c3187bb0af530bbf36cf8619b57d0ea1a (diff) |
Some NULL pointer checks for libyahoo2 - this code's currently crashing
because BitlBee ignores file transfers.
-rw-r--r-- | protocols/yahoo/libyahoo2.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index bd111654..9e0d705b 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -4829,6 +4829,9 @@ static void yahoo_add_active_transfer(struct send_file_data *sfd) static void yahoo_remove_active_transfer(struct send_file_data *sfd) { + if (sfd == NULL) + return; + active_file_transfers = y_list_remove(active_file_transfers, sfd); free(sfd->id); free(sfd->who); @@ -4989,7 +4992,7 @@ static void yahoo_process_filetransferaccept(struct yahoo_input_data *yid, else { YAHOO_CALLBACK(ext_yahoo_file_transfer_done) (yid->yd->client_id, YAHOO_FILE_TRANSFER_UNKNOWN, - sfd->data); + sfd ? sfd->data : NULL); yahoo_remove_active_transfer(sfd); } @@ -5045,7 +5048,7 @@ static void yahoo_process_filetransferinfo(struct yahoo_input_data *yid, else { YAHOO_CALLBACK(ext_yahoo_file_transfer_done) (yid->yd->client_id, YAHOO_FILE_TRANSFER_UNKNOWN, - sfd->data); + sfd ? sfd->data : NULL); yahoo_remove_active_transfer(sfd); } @@ -5160,7 +5163,7 @@ static void yahoo_process_filetransfer(struct yahoo_input_data *yid, else if (!sfd || action == YAHOO_FILE_TRANSFER_REJECT) { YAHOO_CALLBACK(ext_yahoo_file_transfer_done) (yd->client_id, YAHOO_FILE_TRANSFER_REJECT, - sfd->data); + sfd ? sfd->data : NULL); yahoo_remove_active_transfer(sfd); } |