]> git.pld-linux.org Git - packages/lighttpd.git/commitdiff
- prevent crash when empty cgi.assign is used
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 7 Feb 2005 21:18:53 +0000 (21:18 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- see also http://article.gmane.org/gmane.comp.web.lighttpd:1060

Changed files:
    lighttpd-empty_cgi_handler.patch -> 1.1

lighttpd-empty_cgi_handler.patch [new file with mode: 0644]

diff --git a/lighttpd-empty_cgi_handler.patch b/lighttpd-empty_cgi_handler.patch
new file mode 100644 (file)
index 0000000..2c8e7d7
--- /dev/null
@@ -0,0 +1,29 @@
+--- ./src/cgi.c~       2005-02-08 00:08:01.000000000 +0200
++++ ./src/cgi.c        2005-02-08 00:13:02.000000000 +0200
+@@ -686,16 +686,18 @@
+       
+       int to_cgi_fds[2];
+       int from_cgi_fds[2];
+-      struct stat st;
+-      
++
+ #ifndef __WIN32       
++      struct stat st;
+       
+-      /* stat the exec file */
+-      if (-1 == (stat(cgi_handler->ptr, &st))) {
+-              log_error_write(srv, __FILE__, __LINE__, "sbss", 
+-                              "stat for cgi-handler", cgi_handler,
+-                              "failed:", strerror(errno));
+-              return -1;
++      if (cgi_handler->used > 1) {
++              /* stat the exec file */
++              if (-1 == (stat(cgi_handler->ptr, &st))) {
++                      log_error_write(srv, __FILE__, __LINE__, "sbss", 
++                                      "stat for cgi-handler", cgi_handler,
++                                      "failed:", strerror(errno));
++                      return -1;
++              }
+       }
+       
+       if (pipe(to_cgi_fds)) {
This page took 0.240672 seconds and 4 git commands to generate.