From a8ca282033e7c9e9eee645b29935c830e85e8b24 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 7 Jan 2026 13:56:33 +0100 Subject: [PATCH] dh-gex: Initialize best_size to make the code mode straight-forward Coverity thought that the best_nlines could underflow, but the best_size is initialized to 0 before calling this function so its moot. Adjusting the code to be better understandable to static analyzers by initializing the variable inside of the function. Thanks coverity! CID 1548873 Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/dh-gex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dh-gex.c b/src/dh-gex.c index fc444d4b..3c8e5e87 100644 --- a/src/dh-gex.c +++ b/src/dh-gex.c @@ -409,6 +409,7 @@ static int ssh_retrieve_dhgroup_file(FILE *moduli, size_t line = 0; size_t best_nlines = 0; + *best_size = 0; for(;;) { line++; firstbyte = getc(moduli);