[Nagiosplug-checkins] nagiosplug/plugins check_http.c,1.103,1.104

Holger Weiss hweiss at users.sourceforge.net
Sat Jun 2 01:08:27 CEST 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30285

Modified Files:
	check_http.c 
Log Message:
Fix an off-by-one error where a realloc(3) call doesn't allocate space
for nul-termination (Aravind Gottipati - 1729692)


Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- check_http.c	23 May 2007 08:22:32 -0000	1.103
+++ check_http.c	1 Jun 2007 23:08:24 -0000	1.104
@@ -1101,7 +1101,7 @@
     pos += i;
     pos += strspn (pos, " \t\r\n");
 
-    url = realloc (url, strcspn (pos, "\r\n"));
+    url = realloc (url, strcspn (pos, "\r\n") + 1);
     if (url == NULL)
       die (STATE_UNKNOWN, _("HTTP UNKNOWN - could not allocate url\n"));
 





More information about the Commits mailing list