← Commit list

35bbb2e830

Viktor Szakats
Viktor Szakats
2026-03-01
SUCCESS Duration: 304s

Subject

clang-tidy: fix issues found with build-fuzzing

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/curl_sha512_256.c+12 -12
@@ -452,14 +452,14 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
/* Four 'Sigma' macro functions.
See FIPS PUB 180-4 formulae 4.10, 4.11, 4.12, 4.13. */
-#define SIG0(x) \
- (Curl_rotr64((x), 28) ^ Curl_rotr64((x), 34) ^ Curl_rotr64((x), 39))
-#define SIG1(x) \
- (Curl_rotr64((x), 14) ^ Curl_rotr64((x), 18) ^ Curl_rotr64((x), 41))
-#define sig0(x) \
- (Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7))
-#define sig1(x) \
- (Curl_rotr64((x), 19) ^ Curl_rotr64((x), 61) ^ ((x) >> 6))
+#define SIG0(x) \
+ (Curl_rotr64(x, 28) ^ Curl_rotr64(x, 34) ^ Curl_rotr64(x, 39))
+#define SIG1(x) \
+ (Curl_rotr64(x, 14) ^ Curl_rotr64(x, 18) ^ Curl_rotr64(x, 41))
+#define sig0(x) \
+ (Curl_rotr64(x, 1) ^ Curl_rotr64(x, 8) ^ ((x) >> 7))
+#define sig1(x) \
+ (Curl_rotr64(x, 19) ^ Curl_rotr64(x, 61) ^ ((x) >> 6))
if(1) {
unsigned int t;
@@ -520,8 +520,8 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
used. */
#define SHA2STEP64(vA, vB, vC, vD, vE, vF, vG, vH, kt, wt) \
do { \
- (vD) += ((vH) += SIG1((vE)) + Sha512_Ch((vE), (vF), (vG)) + (kt) + (wt)); \
- (vH) += SIG0((vA)) + Sha512_Maj((vA), (vB), (vC)); \
+ (vD) += ((vH) += SIG1(vE) + Sha512_Ch(vE, vF, vG) + (kt) + (wt)); \
+ (vH) += SIG0(vA) + Sha512_Maj(vA, vB, vC); \
} while(0)
/* One step of SHA-512/256 computation with working variables rotation,
@@ -530,7 +530,7 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
#define SHA2STEP64RV(vA, vB, vC, vD, vE, vF, vG, vH, kt, wt) \
do { \
uint64_t tmp_h_ = (vH); \
- SHA2STEP64((vA), (vB), (vC), (vD), (vE), (vF), (vG), tmp_h_, (kt), (wt)); \
+ SHA2STEP64(vA, vB, vC, vD, vE, vF, vG, tmp_h_, kt, wt); \
(vH) = (vG); \
(vG) = (vF); \
(vF) = (vE); \
@@ -546,7 +546,7 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
Input data must be read in big-endian bytes order,
see FIPS PUB 180-4 section 3.1.2. */
#define SHA512_GET_W_FROM_DATA(buf, t) \
- CURL_GET_64BIT_BE(((const uint8_t *)(buf)) + (t) * SHA512_256_BYTES_IN_WORD)
+ CURL_GET_64BIT_BE((const uint8_t *)(buf) + ((t) * SHA512_256_BYTES_IN_WORD))
/* During first 16 steps, before making any calculation on each step, the
W element is read from the input data buffer as a big-endian value and
lib/doh.c+0 -2
@@ -201,7 +201,6 @@ static void doh_print_buf(struct Curl_easy *data,
infof(data, "%s: len=%d, val=%s", prefix, (int)len, hexstr);
else
infof(data, "%s: len=%d (truncated)val=%s", prefix, (int)len, hexstr);
- return;
}
#endif
@@ -1191,7 +1190,6 @@ UNITTEST void doh_print_httpsrr(struct Curl_easy *data,
}
else
infof(data, "HTTPS RR: no ipv6hints");
- return;
}
# endif
#endif
lib/url.c+4 -4
@@ -953,7 +953,7 @@ static bool url_match_proxy_use(struct connectdata *conn,
return TRUE;
}
#else
-#define url_match_proxy_use(c, m) ((void)c, (void)m, TRUE)
+#define url_match_proxy_use(c, m) ((void)(c), (void)(m), TRUE)
#endif
#ifndef CURL_DISABLE_HTTP
@@ -1009,8 +1009,8 @@ static bool url_match_http_version(struct connectdata *conn,
return TRUE;
}
#else
-#define url_match_http_multiplex(c, m) ((void)c, (void)m, TRUE)
-#define url_match_http_version(c, m) ((void)c, (void)m, TRUE)
+#define url_match_http_multiplex(c, m) ((void)(c), (void)(m), TRUE)
+#define url_match_http_version(c, m) ((void)(c), (void)(m), TRUE)
#endif
static bool url_match_proto_config(struct connectdata *conn,
@@ -1178,7 +1178,7 @@ static bool url_match_auth_ntlm(struct connectdata *conn,
return TRUE;
}
#else
-#define url_match_auth_ntlm(c, m) ((void)c, (void)m, TRUE)
+#define url_match_auth_ntlm(c, m) ((void)(c), (void)(m), TRUE)
#endif
#ifdef USE_SPNEGO
lib/vtls/vtls.c+0 -2
@@ -136,7 +136,6 @@ static const struct alpn_spec ALPN_SPEC_H11 = {
static const struct alpn_spec ALPN_SPEC_H10_H11 = {
{ ALPN_HTTP_1_0, ALPN_HTTP_1_1 }, 2
};
-#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_PROXY */
#ifdef USE_HTTP2
static const struct alpn_spec ALPN_SPEC_H2 = {
{ ALPN_H2 }, 1
@@ -149,7 +148,6 @@ static const struct alpn_spec ALPN_SPEC_H11_H2 = {
};
#endif /* USE_HTTP2 */
-#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_PROXY)
static const struct alpn_spec *alpn_get_spec(http_majors wanted,
http_majors preferred,
bool only_http_10,
tests/unit/unit1607.c+1 -0
@@ -25,6 +25,7 @@
#include "urldata.h"
#include "connect.h"
+#include "curl_addrinfo.h"
static CURLcode t1607_setup(void)
{
tests/unit/unit1609.c+1 -0
@@ -25,6 +25,7 @@
#include "urldata.h"
#include "connect.h"
+#include "curl_addrinfo.h"
static CURLcode t1609_setup(void)
{
tests/unit/unit2600.c+1 -0
@@ -46,6 +46,7 @@
#include "cf-ip-happy.h"
#include "multiif.h"
#include "select.h"
+#include "curl_addrinfo.h"
#include "curl_trc.h"
static CURLcode t2600_setup(CURL **easy)