Skip to content

Commit

Permalink
content_encoding: change return code to typedef'ed enum
Browse files Browse the repository at this point in the history
... to work around a clang ubsan warning.

Fixes #12618
Closes #12622
  • Loading branch information
Gisle Vanem authored and bagder committed Jan 2, 2024
1 parent 941b56d commit 8558647
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/content_encoding.c
Expand Up @@ -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;
Expand Down

0 comments on commit 8558647

Please sign in to comment.