From: William A. Rowe Jr Date: Tue, 31 Jul 2001 16:45:10 +0000 (+0000) Subject: Another huge file check, and one fewer emits X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=544593e514b5b334dd77b1c17121b4d7dcdfef82;p=thirdparty%2Fapache%2Fhttpd.git Another huge file check, and one fewer emits git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@89833 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/ssl_expr_eval.c b/ssl_expr_eval.c index 5df703a3d61..2c48fd2238c 100644 --- a/ssl_expr_eval.c +++ b/ssl_expr_eval.c @@ -233,7 +233,12 @@ static char *ssl_expr_eval_func_file(request_rec *r, char *filename) return ""; } apr_file_info_get(&finfo, APR_FINFO_SIZE, fp); - len = finfo.size; + if ((finfo.size + 1) != ((apr_size_t)finfo.size + 1)) { + ssl_expr_error = "Huge file cannot be read"; + apr_file_close(fp); + return ""; + } + len = (apr_size_t)finfo.size; if (len == 0) { buf = (char *)apr_palloc(r->pool, sizeof(char) * 1); *buf = NUL;