Actually, it appears that the code accounts for which being one
less.  The problem is the additional linenum++ introduced in rev
1.64 along with the getline() changes.  We should only be incrementing
linenum for each suitable prime, not every line.

 - todd

Index: usr.bin/ssh/dh.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/dh.c,v
retrieving revision 1.64
diff -u -p -u -r1.64 dh.c
--- usr.bin/ssh/dh.c    6 Jun 2018 18:29:18 -0000       1.64
+++ usr.bin/ssh/dh.c    25 Jun 2018 21:41:52 -0000
@@ -186,7 +186,6 @@ choose_dh(int min, int wantbits, int max
        linenum = 0;
        which = arc4random_uniform(bestcount);
        while (getline(&line, &linesize, f) != -1) {
-               linenum++;
                if (!parse_prime(linenum, line, &dhg))
                        continue;
                if ((dhg.size > max || dhg.size < min) ||

Reply via email to