[Remove entries to the current 2.0 section below, when backported]
+ *) Fix NULL-pointer issue in ab when parsing an incomplete or non-HTTP
+ response. PR 21085. [Glenn Nielsen <glenn@apache.org>, André Malo]
+
*) Added FreeBSD directory layout. PR 21100.
[Sander Holthaus <info@orangexl.com>, André Malo]
/* check response code */
part = strstr(c->cbuff, "HTTP"); /* really HTTP/1.x_ */
- strncpy(respcode, (part + strlen("HTTP/1.x_")), 3);
- respcode[3] = '\0';
+ if (part && strlen(part) > strlen("HTTP/1.x_")) {
+ strncpy(respcode, (part + strlen("HTTP/1.x_")), 3);
+ respcode[3] = '\0';
+ }
+ else {
+ strcpy(respcode, "500");
+ }
+
if (respcode[0] != '2') {
err_response++;
if (verbosity >= 2)
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.123 $> apache-2.0");
+ printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.124 $> 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.123 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.124 $");
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");