]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Another huge file check, and one fewer emits
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 31 Jul 2001 16:45:10 +0000 (16:45 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 31 Jul 2001 16:45:10 +0000 (16:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89833 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_expr_eval.c

index 5df703a3d61a73341708ffa29203a3780a870c16..2c48fd2238c15ed6efd3487fd595555155c0d942 100644 (file)
@@ -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;