]> granicus.if.org Git - apache/commitdiff
* Check for failure of apr_file_info_get call
authorRuediger Pluem <rpluem@apache.org>
Wed, 14 May 2008 20:08:45 +0000 (20:08 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 14 May 2008 20:08:45 +0000 (20:08 +0000)
Reported By: BOYA SUN <boya.sun case.edu>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@656400 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c

index a30745ded91f7096b02f6231507961ea14901657..b2a467c95ffcae270f4cd1779c38af7a9572c59f 100644 (file)
@@ -1945,7 +1945,12 @@ static int open_postfile(const char *pfile)
         return rv;
     }
 
-    apr_file_info_get(&finfo, APR_FINFO_NORM, postfd);
+    rv = apr_file_info_get(&finfo, APR_FINFO_NORM, postfd);
+    if (rv != APR_SUCCESS) {
+        fprintf(stderr, "ab: Could not stat POST data file (%s): %s\n", pfile,
+                apr_strerror(rv, errmsg, sizeof errmsg));
+        return rv;
+    }
     postlen = (apr_size_t)finfo.size;
     postdata = malloc(postlen);
     if (!postdata) {