- ray@cvs.openbsd.org 2007/02/24 03:30:11

[moduli.c]
     - strlen returns size_t, not int.
     - Pass full buffer size to fgets.
     OK djm@, millert@, and moritz@.
This commit is contained in:
Darren Tucker 2007-02-25 20:38:55 +11:00
parent 82347a8fd6
commit 90aaed4397
2 changed files with 9 additions and 6 deletions

View File

@ -14,6 +14,11 @@
- dtucker@cvs.openbsd.org 2007/02/22 12:58:40 - dtucker@cvs.openbsd.org 2007/02/22 12:58:40
[servconf.c] [servconf.c]
Check activep so Match and GatewayPorts work together; ok markus@ Check activep so Match and GatewayPorts work together; ok markus@
- ray@cvs.openbsd.org 2007/02/24 03:30:11
[moduli.c]
- strlen returns size_t, not int.
- Pass full buffer size to fgets.
OK djm@, millert@, and moritz@.
20070219 20070219
- (dtucker) OpenBSD CVS Sync - (dtucker) OpenBSD CVS Sync
@ -2759,4 +2764,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@ passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.4622 2007/02/25 09:37:52 dtucker Exp $ $Id: ChangeLog,v 1.4623 2007/02/25 09:38:55 dtucker Exp $

View File

@ -1,4 +1,4 @@
/* $OpenBSD: moduli.c,v 1.19 2006/11/06 21:25:28 markus Exp $ */ /* $OpenBSD: moduli.c,v 1.20 2007/02/24 03:30:11 ray Exp $ */
/* /*
* Copyright 1994 Phil Karn <karn@qualcomm.com> * Copyright 1994 Phil Karn <karn@qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@ -490,11 +490,9 @@ prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted)
res = 0; res = 0;
lp = xmalloc(QLINESIZE + 1); lp = xmalloc(QLINESIZE + 1);
while (fgets(lp, QLINESIZE, in) != NULL) { while (fgets(lp, QLINESIZE + 1, in) != NULL) {
int ll = strlen(lp);
count_in++; count_in++;
if (ll < 14 || *lp == '!' || *lp == '#') { if (strlen(lp) < 14 || *lp == '!' || *lp == '#') {
debug2("%10u: comment or short line", count_in); debug2("%10u: comment or short line", count_in);
continue; continue;
} }