Changeset cfbecc9 for protocols


Ignore:
Timestamp:
2013-01-06T12:09:35Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
a906b77
Parents:
62a2bf9
Message:

Fixed NULL pointer dereference bug when newly connecting to identi.ca.
Twitter sends us our real username on OAuth completion, which is then used
instead of the username supplied by the user. Identi.ca doesn't supply
this info so BitlBee would instead replace td->user with a NULL pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    r62a2bf9 rcfbecc9  
    193193                g_free(msg);
    194194        } else if (info->stage == OAUTH_ACCESS_TOKEN) {
     195                const char *sn;
     196               
    195197                if (info->token == NULL || info->token_secret == NULL) {
    196198                        imcb_error(ic, "OAuth error: %s", twitter_parse_error(info->http));
    197199                        imc_logout(ic, TRUE);
    198200                        return FALSE;
    199                 } else {
    200                         const char *sn = oauth_params_get(&info->params, "screen_name");
    201 
    202                         if (sn != NULL && ic->acc->prpl->handle_cmp(sn, ic->acc->user) != 0) {
     201                }
     202               
     203                if ((sn = oauth_params_get(&info->params, "screen_name"))) {
     204                        if (ic->acc->prpl->handle_cmp(sn, ic->acc->user) != 0)
    203205                                imcb_log(ic, "Warning: You logged in via OAuth as %s "
    204                                          "instead of %s.", sn, ic->acc->user);
    205                         }
     206                                         "instead of %s.", sn, ic->acc->user);
    206207                        g_free(td->user);
    207208                        td->user = g_strdup(sn);
Note: See TracChangeset for help on using the changeset viewer.