[Remove entries to the current 2.0 section below, when backported]
+ *) ab: Handle long URLs with an error instead of an buffer overflow.
+ PR 28204. [Erik Weide <erik.weidel mplus-technologies.de>, Paul Querna]
+
*) mod_so, core: Add new command line options to print all loaded
modules. '-t -D DUMP_MODULES' and '-M' will show all static
and shared modules as loaded from the configuration file.
apr_time_t start, endtime;
/* global request (and its length) */
-char _request[512];
+char _request[2048];
char *request = _request;
apr_size_t reqlen;
apr_int16_t rv;
long i;
apr_status_t status;
+ int snprintf_res = 0;
#ifdef NOT_ASCII
apr_size_t inbytes_left, outbytes_left;
#endif
/* setup request */
if (posting <= 0) {
- sprintf(request, "%s %s HTTP/1.0\r\n"
+ snprintf_res = apr_snprintf(request, sizeof(_request),
+ "%s %s HTTP/1.0\r\n"
"User-Agent: ApacheBench/%s\r\n"
"%s" "%s" "%s"
"Host: %s%s\r\n"
cookie, auth, host_field, colonhost, hdrs);
}
else {
- sprintf(request, "POST %s HTTP/1.0\r\n"
+ snprintf_res = apr_snprintf(request, sizeof(_request),
+ "POST %s HTTP/1.0\r\n"
"User-Agent: ApacheBench/%s\r\n"
"%s" "%s" "%s"
"Host: %s%s\r\n"
host_field, colonhost, postlen,
(content_type[0]) ? content_type : "text/plain", hdrs);
}
+ if (snprintf_res >= sizeof(_request)) {
+ err("Request too long\n");
+ }
if (verbosity >= 2)
printf("INFO: POST header == \n---\n%s\n---\n", request);
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.145 $> apache-2.0");
+ printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.146 $> apache-2.0");
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
printf("\n");
}
else {
printf("<p>\n");
- printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.145 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.146 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");