From: Dr. David von Oheimb Date: Thu, 17 Jun 2021 11:29:06 +0000 (+0200) Subject: http_client.c: fix HTTP_VERSION_STR_LEN and make it more efficient X-Git-Tag: openssl-3.0.0-beta2~285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47bb597b4fd6fd7b581fe405f71b797243fe96db;p=thirdparty%2Fopenssl.git http_client.c: fix HTTP_VERSION_STR_LEN and make it more efficient Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15796) --- diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c index 1652a2c9a0e..aea53b302ba 100644 --- a/crypto/http/http_client.c +++ b/crypto/http/http_client.c @@ -26,9 +26,9 @@ #define HAS_PREFIX(str, prefix) (strncmp(str, prefix, sizeof(prefix) - 1) == 0) #define HTTP_PREFIX "HTTP/" #define HTTP_VERSION_PATT "1." /* allow 1.x */ +#define HTTP_VERSION_STR_LEN sizeof(HTTP_VERSION_PATT) /* == strlen("1.0") */ #define HTTP_PREFIX_VERSION HTTP_PREFIX""HTTP_VERSION_PATT #define HTTP_1_0 HTTP_PREFIX_VERSION"0" /* "HTTP/1.0" */ -#define HTTP_VERSION_STR_LEN (strlen(HTTP_PREFIX_VERSION) + 1) #define HTTP_LINE1_MINLEN (sizeof(HTTP_PREFIX_VERSION "x 200\n") - 1) #define HTTP_VERSION_MAX_REDIRECTIONS 50