DoS fix in nginx http autoindex module, from MAINTAINER Darrin Chandler

ok merdely@
This commit is contained in:
sthen 2007-09-22 21:06:05 +00:00
parent 9e43fcf5dd
commit 1fa766a479
2 changed files with 17 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2007/09/04 21:58:26 merdely Exp $
# $OpenBSD: Makefile,v 1.2 2007/09/22 21:06:05 sthen Exp $
COMMENT= robust and small HTTP server and IMAP/POP3 proxy server
DISTNAME= nginx-0.5.31
PKGNAME= ${DISTNAME}p0
CATEGORIES= www
HOMEPAGE= http://nginx.net/

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_http_modules_ngx_http_autoindex_module_c,v 1.1 2007/09/22 21:06:06 sthen Exp $
--- src/http/modules/ngx_http_autoindex_module.c.orig Sat Sep 22 21:51:41 2007
+++ src/http/modules/ngx_http_autoindex_module.c Sat Sep 22 21:53:41 2007
@@ -236,6 +236,11 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
rc = ngx_http_send_header(r);
if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
+ if (ngx_close_dir(&dir) == NGX_ERROR) {
+ ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
+ ngx_close_dir_n " \"%V\" failed", &path);
+ }
+
return rc;
}