Changeset 4543b6bd for protocols/jabber


Ignore:
Timestamp:
2015-04-04T01:23:59Z (10 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
71abe93
Parents:
3dcc878
Message:

jabber: Fixed null deref when receiving <subject> from oneself

If the from="..." of the message that includes a subject refers to us,
that buddy object won't have an ext_jid set, and passing that to
strchr() results in pain.

This happens with recent versions of an xmpp server called "lets-chat".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    r3dcc878 r4543b6bd  
    359359
    360360        if (subject && chat) {
    361                 s = bud ? strchr(bud->ext_jid, '/') : NULL;
     361                s = (bud && bud->ext_jid) ? strchr(bud->ext_jid, '/') : NULL;
    362362                if (s) {
    363363                        *s = 0;
     
    419419        }
    420420        if (body && body->text_len > 0) {
    421                 s = strchr(bud->ext_jid, '/');
     421                s = (bud->ext_jid) ? strchr(bud->ext_jid, '/') : NULL;
    422422                if (s) {
    423423                        *s = 0;
Note: See TracChangeset for help on using the changeset viewer.