SIGSEGV in check.c on Solaris when plugin output is empty

thuebler at sachsendv.de thuebler at sachsendv.de
Wed Sep 24 16:10:03 CEST 2008


Hi list,

nagios dumps core with SIGSEV on Solaris 10 when a plugin does not print 
any output.
Using gdb I found it happening in line 803 of base/checks.c, where 
checkresult_dbuf.buf is 0x0 on empty plugin output.

Versions:
- nagios-3.0.3 and nagios-cvs (as of 24. Sept 2008)
- Solaris 10 x86
- both Sun Studio 11 and gcc

I tried a fix just in place by inserting a NULL pointer check just before 
the fprintf in line 803 ... maybe there is a more elegant solution.
 
On linux, glibc seems to handel this problem in printf("output=%s", NULL) 
by returning the string "(null)".


Regards,
Torsten
===


_________________________________________________________________

Sachsen DV Betriebs- und Servicegesellschaft mbH
Täubchenweg 26
04317 Leipzig
Amtsgericht Leipzig, HRB 18545

Geschäftsführer: Herbert Roller Brandão, Dr. Jean-Michael Pfitzner

Aufsichtsratsvorsitzender: Andreas Benninger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20080924/13ff52cf/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list