[Nagiosplug-devel] [ nagiosplug-Bugs-2212260 ] [patch] ID: 2179754

SourceForge.net noreply at sourceforge.net
Fri Feb 20 00:46:54 CET 2009


Bugs item #2212260, was opened at 2008-10-31 17:40
Message generated for change (Comment added) made by tonvoon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2212260&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: None
>Status: Closed
>Resolution: Duplicate
Priority: 5
Private: No
Submitted By: mumpitz (ohauer)
>Assigned to: Ton Voon (tonvoon)
Summary: [patch] ID: 2179754

Initial Comment:
In check_nt.c exist a error (case CHECK_USEDDISKSPACE:), which segfaults the 
plugin if used for example with nrpe++ and a query to an non existent drive.

The error is as follows.
The first call in the sequence searches the string pointed to by s1 for the 
first byte that is not contained in the current separator string pointed to 
by s2. If no such byte is found, then there are no tokens in the string 
pointed to by s1 and strtok() returns a null pointer. If such a byte is 
found, it is the start of the first token. 
(http://www.opengroup.org/onlinepubs/007908775/xsh/strtok.html)

If for example the nrpe++ plugin return the following for a drive query: 
UNKNOWN: Drive is not a fixed drive: d: (it is a cdrom drive)

Now the following happens:
 - the seperator '&' is not provided in the return string
 - strtok(recv_buffer,"&") returns the full unexpected string to atof.
 - atof return NULL or random data
 - strtok(NULL, "&") returns NULL
 - atof(NULL) -> *segfault*

So it is saver but not perfect (usage of atof) with the patch ID: 2179754

I attached the patch from ID 217954 again to this bug 


----------------------------------------------------------------------

>Comment By: Ton Voon (tonvoon)
Date: 2009-02-19 23:46

Message:
Duplicate of 2179754.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2212260&group_id=29880




More information about the Devel mailing list