--- lighttpd-1.4.23/src/mod_cgi.c.org 2009-10-09 20:25:41.998318718 +0200 +++ lighttpd-1.4.23/src/mod_cgi.c 2009-10-09 20:28:50.680100649 +0200 @@ -732,9 +732,9 @@ #ifndef __WIN32 - if (cgi_handler->used > 1) { + if (cgi_handler->used > 1 && strlen(cgi_handler->ptr+2) > 0) { /* stat the exec file */ - if (-1 == (stat(cgi_handler->ptr, &st))) { + if (-1 == (stat(cgi_handler->ptr+2, &st))) { log_error_write(srv, __FILE__, __LINE__, "sbss", "stat for cgi-handler", cgi_handler, "failed:", strerror(errno)); @@ -1002,8 +1002,8 @@ args = malloc(sizeof(*args) * argc); i = 0; - if (cgi_handler->used > 1) { - args[i++] = cgi_handler->ptr; + if (cgi_handler->used > 1 && strlen(cgi_handler->ptr+2) > 0) { + args[i++] = cgi_handler->ptr+2; } args[i++] = con->physical.path->ptr; args[i ] = NULL;