content_encoding: change return code to typedef'ed enum

... to work around a clang ubsan warning.

Fixes #12618
Closes #12622
This commit is contained in:
Gisle Vanem 2024-01-02 17:02:13 +01:00 committed by Daniel Stenberg
parent 941b56d790
commit 8558647613
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -365,11 +365,14 @@ static CURLcode gzip_do_init(struct Curl_easy *data,
#ifdef OLD_ZLIB_SUPPORT
/* Skip over the gzip header */
static enum {
typedef enum {
GZIP_OK,
GZIP_BAD,
GZIP_UNDERFLOW
} check_gzip_header(unsigned char const *data, ssize_t len, ssize_t *headerlen)
} gzip_status;
static gzip_status check_gzip_header(unsigned char const *data, ssize_t len,
ssize_t *headerlen)
{
int method, flags;
const ssize_t totallen = len;