From: Gisle Vanem Date: Tue, 2 Jan 2024 16:02:13 +0000 (+0100) Subject: content_encoding: change return code to typedef'ed enum X-Git-Tag: curl-8_6_0~148 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8558647613ab4d25cc77e52ebbd2454d2225b1cc;p=thirdparty%2Fcurl.git content_encoding: change return code to typedef'ed enum ... to work around a clang ubsan warning. Fixes #12618 Closes #12622 --- diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 4167d4d684..de75dd6867 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -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;