mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
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 <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -409,6 +409,7 @@ static int ssh_retrieve_dhgroup_file(FILE *moduli,
|
|||||||
size_t line = 0;
|
size_t line = 0;
|
||||||
size_t best_nlines = 0;
|
size_t best_nlines = 0;
|
||||||
|
|
||||||
|
*best_size = 0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
line++;
|
line++;
|
||||||
firstbyte = getc(moduli);
|
firstbyte = getc(moduli);
|
||||||
|
|||||||
Reference in New Issue
Block a user