[PATCH] Fix memory corruption caused by a backslashes

Michael Marineau mmarineau at itasoftware.com
Tue Apr 7 02:07:53 CEST 2009


Greetings,

The function unescape_newlines in cgi/cgiutils.c will blindly unescape
any character preceded by the backslash by taking the value of the next
character and incrementing to skip over it. This happens even when that
next character is the terminating null, causing the loop to continue on
corrupting memory until it hits another null character. The attached
patch should fix this issue. It is against 3.0.6 but should still apply
to the latest code.

This bug is triggered when any plugin's output ends with a backslash
which has been reported at least a couple times, most recently here:
http://thread.gmane.org/gmane.network.nagios.devel/6109/focus=6117

Cheers,
-- 
Michael Marineau
ITA Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-3.0.6-fix-trailing-backslash.patch
Type: text/x-patch
Size: 302 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090406/90d54a3a/attachment.bin>
-------------- next part --------------
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
-------------- 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