From: <st...@us...> - 2011-10-13 11:55:52
|
Revision: 6766 http://xymon.svn.sourceforge.net/xymon/?rev=6766&view=rev Author: storner Date: 2011-10-13 11:55:42 +0000 (Thu, 13 Oct 2011) Log Message: ----------- hostlist CGI: Dont crash on a HTTP HEAD request Modified Paths: -------------- trunk/web/hostlist.c Modified: trunk/web/hostlist.c =================================================================== --- trunk/web/hostlist.c 2011-10-13 11:55:08 UTC (rev 6765) +++ trunk/web/hostlist.c 2011-10-13 11:55:42 UTC (rev 6766) @@ -69,6 +69,7 @@ char *req, *board, *l; int argi, res; sendreturn_t *sres; + char *cookie; pcre *dummy; init_timestamp(); @@ -86,7 +87,8 @@ } } - sethostenv_pagepath(get_cookie("pagepath")); + cookie = get_cookie("pagepath"); + if (cookie) sethostenv_pagepath(cookie); cgidata = cgi_request(); if (cgidata == NULL) { @@ -98,9 +100,9 @@ } parse_query(); - dummy = compileregex(testfilter); + dummy = (testfilter ? compileregex(testfilter) : NULL); if (dummy == NULL) return 1; else freeregex(dummy); - dummy = compileregex(pagefilter); + dummy = (pagefilter ? compileregex(pagefilter) : NULL); if (dummy == NULL) return 1; else freeregex(dummy); sres = newsendreturnbuf(1, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |