From 8bd53fd5298946a23be972ba28172ddb7a7d877f Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 14 May 2008 20:08:45 +0000 Subject: [PATCH] * Check for failure of apr_file_info_get call Reported By: BOYA SUN git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@656400 13f79535-47bb-0310-9956-ffa450edef68 --- support/ab.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/support/ab.c b/support/ab.c index a30745ded9..b2a467c95f 100644 --- a/support/ab.c +++ b/support/ab.c @@ -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) { -- 2.50.1