[hobbit] SIGBUS in bbcombotest [solved...see diff]

Henrik Stoerner henrik at hswn.dk
Wed Jul 5 16:21:46 CEST 2006


This patch is wrong; in some circumstances it will assign "result" to an
empty string, and then return a pointer that is past the end of the
empty string.

Could you provide me with an example of what you have in the 
bbcombotest.cfg file that triggers this problem ?


Regards,

Henrik


On Wed, Jul 05, 2006 at 03:44:33PM +0200, Nicolas Dorfsman wrote:
> *** bbcombotest.c.orig  Fri May 19 14:02:54 2006
> --- bbcombotest.c       Wed Jul  5 15:43:22 2006
> ***************
> *** 69,77 ****
> 
>         /* grab the testname part from a "www.xxx.com.testname"  
> string */
>         p = strrchr(spec, '.');
> !       if (p) result = strdup(p+1); else result = "";
> 
> !       return result;
>   }
> 
>   static void flush_valuelist(value_t *head)
> --- 69,81 ----
> 
>         /* grab the testname part from a "www.xxx.com.testname"  
> string */
>         p = strrchr(spec, '.');
> !       if (p) {
> !               result = strdup(p);
> !       }
> !       else
> !               result = "";
> 
> !       return result+1;
>   }
> 
>   static void flush_valuelist(value_t *head)
> 
> 
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
> 
> 

-- 
Henrik Storner



More information about the Xymon mailing list