xiehuc / pidgin-lwqq

a pidgin plugin based on lwqq, a excellent safe useful library for webqq protocol
GNU General Public License v3.0
660 stars 185 forks source link

segfault doubleclicking on name #364

Closed CapnKernel closed 11 years ago

CapnKernel commented 11 years ago

Program received signal SIGSEGV, Segmentation fault. 0x00007fe412c06de6 in qq_get_cb_real_name (gc=0x22108e0, id=1, who=0x2a599d6 "2525403540") at /usr/src/debug/pidgin-lwqq/src/webqq.c:1943 1943 snprintf(conv_name,sizeof(conv_name),"%s ### %s",(sb->card)?sb->card:sb->nick,group->name); (gdb) info locals group = 0x2209040 sb = 0x0 ac = 0x220d930 conv_name = '\000' <repeats 69 times> (gdb) list 1938 return NULL; 1939 else { 1940 LwqqGroup* group = opend_chat_index(ac,id); 1941 LwqqSimpleBuddy* sb = find_group_member_by_nick_or_card(group,who); 1942 //if(sb==NULL) sb = lwqq_group_find_group_member_by_uin(group, who); 1943 snprintf(conv_name,sizeof(conv_name),"%s ### %s",(sb->card)?sb->card:sb->nick,group->name); 1944 return s_strdup(conv_name); 1945 } 1946 return NULL; 1947 }

xiehuc commented 11 years ago

how you trigger this bug. it looks like sb==NULL

2013/8/6 Mitch Davis notifications@github.com

Program received signal SIGSEGV, Segmentation fault. 0x00007fe412c06de6 in qq_get_cb_real_name (gc=0x22108e0, id=1, who=0x2a599d6 "2525403540") at /usr/src/debug/pidgin-lwqq/src/webqq.c:1943 1943 snprintf(conv_name,sizeof(conv_name),"%s ### %s",(sb->card)?sb->card:sb->nick,group->name); (gdb) info locals group = 0x2209040 sb = 0x0 ac = 0x220d930 conv_name = '\000' (gdb) list 1938 return NULL; 1939 else { 1940 LwqqGroup* group = opend_chat_index(ac,id); 1941 LwqqSimpleBuddy* sb = find_group_member_by_nick_or_card(group,who); 1942 //if(sb==NULL) sb = lwqq_group_find_group_member_by_uin(group, who); 1943 snprintf(conv_name,sizeof(conv_name),"%s ### %s",(sb->card)?sb->card:sb->nick,group->name); 1944 return s_strdup(conv_name); 1945 } 1946 return NULL; 1947 }

— Reply to this email directly or view it on GitHubhttps://github.com/xiehuc/pidgin-lwqq/issues/364 .

CapnKernel commented 11 years ago

Yes sb is null. Really an sb.

In a QQ群 there was someone with no name. I double-clicked on their name (left hand side in the conversation, not on the right in the name list). Then Pidgin crashed.

CapnKernel commented 11 years ago

Have a look at this picture. I just right-clicked on the person's number, and it instantly crashed.

pidgin-364-crash

xiehuc commented 11 years ago

can i use chinese?

because i found webqq protocol member infomation not fullly match , that is ,some simple buddy didn't have a nick name, so i copied from qq, i think this is the reason.

now i didn't understand why there are unmatch, so i did need much time to get know what's means behind.after this, i could do some change correctly.

CapnKernel commented 11 years ago

我是西方人 :-)

If you'd like me to do some testing, please let me know.

Mitch.

xiehuc commented 11 years ago

please check out dev; and use git submodule update to update liblwqq

to check whether it solves

xiehuc commented 11 years ago

please test again