Changeset 3bb333c for protocols


Ignore:
Timestamp:
2015-03-11T21:24:15Z (5 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
89db90e, fedc8f1
Parents:
afbad28
git-author:
dequis <dx@…> (04-03-15 00:49:21)
git-committer:
dequis <dx@…> (11-03-15 21:24:15)
Message:

purple: Implement 'close_request' to prevent segfaults after logout

Fixes trac bug 1190 ("Accepting SSL certs too late resets bitlbee-libpurple")

To reproduce:

  1. Connect to server with self-signed ssl certificate (downgrading to libpurple 2.10.9 might be required to actually get the request)
  2. Disconnect the account
  3. Type "yes"
  4. Acquire segfault.

Normally, query_del_by_conn() would handle this, but some requests have
no account context at all. Yeah, it sucks. This is how pidgin handles it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    rafbad28 r3bb333c  
    10481048}
    10491049
     1050/* So it turns out some requests have no account context at all, because
     1051 * libpurple hates us. This means that query_del_by_conn() won't remove those
     1052 * on logout, and will segfault if the user replies. That's why this exists.
     1053 */
     1054static void prplcb_close_request(PurpleRequestType type, void *data)
     1055{
     1056        if (type == PURPLE_REQUEST_ACTION) {
     1057                struct prplcb_request_action_data *pqad = data;
     1058                query_del(local_bee->ui_data, pqad->bee_data);
     1059        }
     1060        /* Add the request input handler here when that becomes a thing */
     1061}
     1062
    10501063/*
    10511064static void prplcb_request_test()
     
    10621075        NULL,
    10631076        NULL,
    1064         NULL,
     1077        prplcb_close_request,
    10651078        NULL,
    10661079};
Note: See TracChangeset for help on using the changeset viewer.