Thread (1 message) 1 message, 1 author, 2020-04-22

Re: [PATCH] builtin/receive-pack: use constant-time comparison for HMAC value

From: Junio C Hamano <hidden>
Date: 2020-04-22 15:57:21
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Subject: receive-pack: compilation fix

We do not use C99 "for loop initial declaration" in our codebase
(yet), but one snuck in.

Reported-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 builtin/receive-pack.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 45e2dd2a65..66149777a0 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -505,7 +505,9 @@ static char *find_header(const char *msg, size_t len, const char *key,
 static int constant_memequal(const char *a, const char *b, size_t n)
 {
 	int res = 0;
-	for (size_t i = 0; i < n; i++)
+	size_t i;
+
+	for (i = 0; i < n; i++)
 		res |= a[i] ^ b[i];
 	return res;
 }
-- 
2.26.2-108-g048abe1751
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help