Modify

#1101 closed defect (fixed)

[Patch] null pointer in nick_gen

Reported by: Daniel Albers <daniel@…> Owned by:
Priority: normal Milestone:
Component: BitlBee Version: 3.2
Keywords: patch Cc:
IRC client+version: Client-independent Operating System: Public server
OS version/distro:

Description

Attached trivial patch fixes this AFAICS.

(gdb) bt #0 0x00007ffff67f455a in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x000055555557a513 in nick_gen (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:212 #2 0x000055555557a03e in nick_get (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:83 #3 0x0000555555571331 in bee_irc_user_nick_update (iu=0x555555857d50) at /usr/src/bitlbee/irc_im.c:376 #4 0x0000555555571236 in bee_irc_user_nick_hint (bee=0x55555581ba80, bu=0x555555857c00, hint=0x5555558572b0 "V\352nus")

at /usr/src/bitlbee/irc_im.c:336

#5 0x00005555555950aa in imcb_buddy_nick_hint (ic=0x55555581bb80, handle=0x5555557fe700 "93764954", nick=0x5555558572b0 "V\352nus")

at /usr/src/bitlbee/protocols/nogaim.c:462

#6 0x00005555555c665b in gaim_ssi_parselist (sess=0x55555582e7c0, fr=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/oscar.c:1972 #7 0x00005555555bd936 in parsedata (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)

at /usr/src/bitlbee/protocols/oscar/ssi.c:945

#8 0x00005555555be373 in snachandler (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)

at /usr/src/bitlbee/protocols/oscar/ssi.c:1182

#9 0x00005555555b8599 in consumesnac (sess=0x55555582e7c0, rx=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:121 #10 0x00005555555b8b61 in aim_rxdispatch (sess=0x55555582e7c0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:335 #11 0x00005555555bfd2b in oscar_callback (data=0x55555582ee40, source=12, condition=B_EV_IO_READ)

at /usr/src/bitlbee/protocols/oscar/oscar.c:291

#12 0x00005555555845c2 in b_event_passthrough (fd=12, event=2, data=0x555555833480) at /usr/src/bitlbee/lib/events_libevent.c:147 #13 0x00007ffff74a0ccc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5 #14 0x00005555555844c3 in b_main_run () at /usr/src/bitlbee/lib/events_libevent.c:86 #15 0x0000555555581b7b in main (argc=6, argv=0x7fffffffe5a8) at /usr/src/bitlbee/unix.c:183 (gdb) down #0 0x00007ffff67f455a in ?? () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt #0 0x00007ffff67f455a in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x000055555557a513 in nick_gen (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:212 #2 0x000055555557a03e in nick_get (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:83 #3 0x0000555555571331 in bee_irc_user_nick_update (iu=0x555555857d50) at /usr/src/bitlbee/irc_im.c:376 #4 0x0000555555571236 in bee_irc_user_nick_hint (bee=0x55555581ba80, bu=0x555555857c00, hint=0x5555558572b0 "V\352nus")

at /usr/src/bitlbee/irc_im.c:336

#5 0x00005555555950aa in imcb_buddy_nick_hint (ic=0x55555581bb80, handle=0x5555557fe700 "93764954", nick=0x5555558572b0 "V\352nus")

at /usr/src/bitlbee/protocols/nogaim.c:462

#6 0x00005555555c665b in gaim_ssi_parselist (sess=0x55555582e7c0, fr=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/oscar.c:1972 #7 0x00005555555bd936 in parsedata (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)

at /usr/src/bitlbee/protocols/oscar/ssi.c:945

#8 0x00005555555be373 in snachandler (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)

at /usr/src/bitlbee/protocols/oscar/ssi.c:1182

#9 0x00005555555b8599 in consumesnac (sess=0x55555582e7c0, rx=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:121 #10 0x00005555555b8b61 in aim_rxdispatch (sess=0x55555582e7c0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:335 #11 0x00005555555bfd2b in oscar_callback (data=0x55555582ee40, source=12, condition=B_EV_IO_READ)

at /usr/src/bitlbee/protocols/oscar/oscar.c:291

#12 0x00005555555845c2 in b_event_passthrough (fd=12, event=2, data=0x555555833480) at /usr/src/bitlbee/lib/events_libevent.c:147 #13 0x00007ffff74a0ccc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5 #14 0x00005555555844c3 in b_main_run () at /usr/src/bitlbee/lib/events_libevent.c:86 #15 0x0000555555581b7b in main (argc=6, argv=0x7fffffffe5a8) at /usr/src/bitlbee/unix.c:183 (gdb) up #1 0x000055555557a513 in nick_gen (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:212 212 if( chop && ( s = strchr( part, chop ) ) ) (gdb) i lo chop = 64 '@' asc = 0x0 s = 0x7ffff7711669 "\203\370\001A\211Ƹ\002" len = 2147483647 part = 0x0 ok = 1 ret = 0x555555802800 rets = 0x7fffffffde70 "\260\336\377\377\377\177" irc = 0x55555581c1e0 fmt = 0x555555811be7 ""

Attachments (1)

nick_gen-nullptr.patch (422 bytes) - added by Daniel Albers <daniel@…> at 2013-12-10T12:24:25Z.

Download all attachments as: .zip

Change History (6)

Changed at 2013-12-10T12:24:25Z by Daniel Albers <daniel@…>

Attachment: nick_gen-nullptr.patch added

comment:1 Changed at 2013-12-10T12:26:32Z by Daniel Albers <daniel@…>

Apologies, once again properly formatted:

(gdb) bt
#0  0x00007ffff67f455a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x000055555557a513 in nick_gen (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:212
#2  0x000055555557a03e in nick_get (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:83
#3  0x0000555555571331 in bee_irc_user_nick_update (iu=0x555555857d50) at /usr/src/bitlbee/irc_im.c:376
#4  0x0000555555571236 in bee_irc_user_nick_hint (bee=0x55555581ba80, bu=0x555555857c00, hint=0x5555558572b0 "V\352nus")
    at /usr/src/bitlbee/irc_im.c:336
#5  0x00005555555950aa in imcb_buddy_nick_hint (ic=0x55555581bb80, handle=0x5555557fe700 "93764954", nick=0x5555558572b0 "V\352nus")
    at /usr/src/bitlbee/protocols/nogaim.c:462
#6  0x00005555555c665b in gaim_ssi_parselist (sess=0x55555582e7c0, fr=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/oscar.c:1972
#7  0x00005555555bd936 in parsedata (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)
    at /usr/src/bitlbee/protocols/oscar/ssi.c:945
#8  0x00005555555be373 in snachandler (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)
    at /usr/src/bitlbee/protocols/oscar/ssi.c:1182
#9  0x00005555555b8599 in consumesnac (sess=0x55555582e7c0, rx=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:121
#10 0x00005555555b8b61 in aim_rxdispatch (sess=0x55555582e7c0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:335
#11 0x00005555555bfd2b in oscar_callback (data=0x55555582ee40, source=12, condition=B_EV_IO_READ)
    at /usr/src/bitlbee/protocols/oscar/oscar.c:291
#12 0x00005555555845c2 in b_event_passthrough (fd=12, event=2, data=0x555555833480) at /usr/src/bitlbee/lib/events_libevent.c:147
#13 0x00007ffff74a0ccc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#14 0x00005555555844c3 in b_main_run () at /usr/src/bitlbee/lib/events_libevent.c:86
#15 0x0000555555581b7b in main (argc=6, argv=0x7fffffffe5a8) at /usr/src/bitlbee/unix.c:183
(gdb) down
#0  0x00007ffff67f455a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff67f455a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x000055555557a513 in nick_gen (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:212
#2  0x000055555557a03e in nick_get (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:83
#3  0x0000555555571331 in bee_irc_user_nick_update (iu=0x555555857d50) at /usr/src/bitlbee/irc_im.c:376
#4  0x0000555555571236 in bee_irc_user_nick_hint (bee=0x55555581ba80, bu=0x555555857c00, hint=0x5555558572b0 "V\352nus")
    at /usr/src/bitlbee/irc_im.c:336
#5  0x00005555555950aa in imcb_buddy_nick_hint (ic=0x55555581bb80, handle=0x5555557fe700 "93764954", nick=0x5555558572b0 "V\352nus")
    at /usr/src/bitlbee/protocols/nogaim.c:462
#6  0x00005555555c665b in gaim_ssi_parselist (sess=0x55555582e7c0, fr=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/oscar.c:1972
#7  0x00005555555bd936 in parsedata (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)
    at /usr/src/bitlbee/protocols/oscar/ssi.c:945
#8  0x00005555555be373 in snachandler (sess=0x55555582e7c0, mod=0x55555582ed50, rx=0x55555583fbc0, snac=0x7fffffffe160, bs=0x55555583fbc8)
    at /usr/src/bitlbee/protocols/oscar/ssi.c:1182
#9  0x00005555555b8599 in consumesnac (sess=0x55555582e7c0, rx=0x55555583fbc0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:121
#10 0x00005555555b8b61 in aim_rxdispatch (sess=0x55555582e7c0) at /usr/src/bitlbee/protocols/oscar/rxhandlers.c:335
#11 0x00005555555bfd2b in oscar_callback (data=0x55555582ee40, source=12, condition=B_EV_IO_READ)
    at /usr/src/bitlbee/protocols/oscar/oscar.c:291
#12 0x00005555555845c2 in b_event_passthrough (fd=12, event=2, data=0x555555833480) at /usr/src/bitlbee/lib/events_libevent.c:147
#13 0x00007ffff74a0ccc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#14 0x00005555555844c3 in b_main_run () at /usr/src/bitlbee/lib/events_libevent.c:86
#15 0x0000555555581b7b in main (argc=6, argv=0x7fffffffe5a8) at /usr/src/bitlbee/unix.c:183
(gdb) up
#1  0x000055555557a513 in nick_gen (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:212
212                     if( chop && ( s = strchr( part, chop ) ) )
(gdb) i lo
chop = 64 '@'
asc = 0x0
s = 0x7ffff7711669 "\203\370\001A\211Ƹ\002"
len = 2147483647
part = 0x0
ok = 1
ret = 0x555555802800
rets = 0x7fffffffde70 "\260\336\377\377\377\177"
irc = 0x55555581c1e0
fmt = 0x555555811be7 ""

comment:2 Changed at 2013-12-10T12:31:50Z by Daniel Albers <daniel@…>

Was asked on #bitlbee how to get there, I only have this:

(gdb) up
#2  0x000055555557a03e in nick_get (bu=0x555555857c00) at /usr/src/bitlbee/nick.c:83
83              else if( ( found_nick = nick_gen( bu ) ) )
(gdb) print bu
$3 = (bee_user_t *) 0x555555857c00
(gdb) p *bu
$4 = {ic = 0x55555581bb80, handle = 0x555555857cf0 "93764954", fullname = 0x0, nick = 0x555555857e70 "V\352nus", group = 0x55555584c070, 
  flags = 0, status = 0x0, status_msg = 0x0, login_time = 0, idle_time = 0, bee = 0x55555581ba80, ui_data = 0x555555857d50, data = 0x0}

comment:3 Changed at 2014-02-04T04:35:48Z by dx

Keywords: patch added

comment:4 Changed at 2014-02-04T11:17:52Z by anonymous

FWIW, I have been using this patch since creation of this bug report without any problems.

comment:5 Changed at 2014-03-01T02:08:46Z by dx

Resolution: fixed
Status: newclosed

Applied in r1012, thanks!

Modify Ticket

Action
as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.