]> git.cameronkatri.com Git - mandoc.git/commitdiff
oops, we must not try to validate a manpath we don't have;
authorIngo Schwarze <schwarze@openbsd.org>
Fri, 25 Jul 2014 19:37:34 +0000 (19:37 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Fri, 25 Jul 2014 19:37:34 +0000 (19:37 +0000)
fixing an oversight introduced in rev. 1.77

cgi.c

diff --git a/cgi.c b/cgi.c
index 04a02d63819b233a35dad2f8c40721d9ae5f5e31..36e069fc4f2c21ee4c2efadb336e3fc8cd7dd817 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/*     $Id: cgi.c,v 1.88 2014/07/25 18:20:39 schwarze Exp $ */
+/*     $Id: cgi.c,v 1.89 2014/07/25 19:37:34 schwarze Exp $ */
 /*
  * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de>
@@ -1086,7 +1086,8 @@ main(void)
        if (NULL != (querystring = getenv("QUERY_STRING")))
                http_parse(&req, querystring);
 
-       if ( ! validate_manpath(&req, req.q.manpath)) {
+       if ( ! (NULL == req.q.manpath ||
+           validate_manpath(&req, req.q.manpath))) {
                pg_error_badrequest(
                    "You specified an invalid manpath.");
                return(EXIT_FAILURE);