Re: core segfaults (Yahoo?)

"A. Craig West" <[email protected]> Fri, 5 Mar 2004 18:59:38 -0500 (EST)
Newsgroups gmane.network.everybuddy.devel
Message-ID <[email protected]>
On Fri, 5 Mar 2004, Karine Proot wrote:

> Core dumped by eb-lite when I closed ebqt :
> 
> (gdb) bt
> #0  0x4020d283 in strlen () from /lib/libc.so.6
> #1  0x4020cf15 in strdup () from /lib/libc.so.6
> #2  0x40308bc4 in ext_yahoo_status_changed (id=1, who=0x8075118
> "edhel_eb",
>     stat=0, msg=0x0, away=1) at yahoo.c:671
> #3  0x402fd36b in yahoo_process_status (yid=0x0, pkt=0x8072e70)
>     at libyahoo2.c:1397

This is very odd, because as far as I can tell, that trace #2 should say
stat=0x5a55aa56 or something similar. All the other values look okay, and this
does point out an actual bug in the code, which is fixed by this patch. I
am suspicious of this bad value, though. It implies that the stack has been
walked on, but nothing else on the stack looks unusual.

-----------------------Patch Begins-----------------------------
Index: plugins/yahoo/yahoo.c
===================================================================
--- plugins/yahoo/yahoo.c	(revision 303)
+++ plugins/yahoo/yahoo.c	(working copy)
@@ -669,7 +669,7 @@
     default:
     {
       acc->status = away ? EB_ACCOUNT_AWAY : EB_ACCOUNT_ONLINE;
-      acc->status_string = strdup(msg);
+      acc->status_string = msg ? (strdup(msg)) : (strdup("Unknown"));
     }
   }
 
-----------------------Patch Ends-----------------------------



-- 
Craig West         Ph: (416) 666-1645	|  It's not a bug,
[email protected]              	|  It's a feature...