summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-02-25 20:38:55 +1100
committerDarren Tucker <dtucker@zip.com.au>2007-02-25 20:38:55 +1100
commit90aaed43979c6b4e42b41ef8dc2a970df248c2c7 (patch)
treed691df6b05851c7288798046e6d38d9c63b2f6c7
parent82347a8fd67d294537b0a95e8ea5b7b7912ced11 (diff)
- 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@.
-rw-r--r--ChangeLog7
-rw-r--r--moduli.c8
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 36528ad71..4e5392760 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,11 @@
14 - dtucker@cvs.openbsd.org 2007/02/22 12:58:40 14 - dtucker@cvs.openbsd.org 2007/02/22 12:58:40
15 [servconf.c] 15 [servconf.c]
16 Check activep so Match and GatewayPorts work together; ok markus@ 16 Check activep so Match and GatewayPorts work together; ok markus@
17 - ray@cvs.openbsd.org 2007/02/24 03:30:11
18 [moduli.c]
19 - strlen returns size_t, not int.
20 - Pass full buffer size to fgets.
21 OK djm@, millert@, and moritz@.
17 22
1820070219 2320070219
19 - (dtucker) OpenBSD CVS Sync 24 - (dtucker) OpenBSD CVS Sync
@@ -2759,4 +2764,4 @@
2759 OpenServer 6 and add osr5bigcrypt support so when someone migrates 2764 OpenServer 6 and add osr5bigcrypt support so when someone migrates
2760 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 2765 passwords between UnixWare and OpenServer they will still work. OK dtucker@
2761 2766
2762$Id: ChangeLog,v 1.4622 2007/02/25 09:37:52 dtucker Exp $ 2767$Id: ChangeLog,v 1.4623 2007/02/25 09:38:55 dtucker Exp $
diff --git a/moduli.c b/moduli.c
index 44e5ddfc0..8fa545daf 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: moduli.c,v 1.19 2006/11/06 21:25:28 markus Exp $ */ 1/* $OpenBSD: moduli.c,v 1.20 2007/02/24 03:30:11 ray Exp $ */
2/* 2/*
3 * Copyright 1994 Phil Karn <karn@qualcomm.com> 3 * Copyright 1994 Phil Karn <karn@qualcomm.com>
4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> 4 * 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)
490 490
491 res = 0; 491 res = 0;
492 lp = xmalloc(QLINESIZE + 1); 492 lp = xmalloc(QLINESIZE + 1);
493 while (fgets(lp, QLINESIZE, in) != NULL) { 493 while (fgets(lp, QLINESIZE + 1, in) != NULL) {
494 int ll = strlen(lp);
495
496 count_in++; 494 count_in++;
497 if (ll < 14 || *lp == '!' || *lp == '#') { 495 if (strlen(lp) < 14 || *lp == '!' || *lp == '#') {
498 debug2("%10u: comment or short line", count_in); 496 debug2("%10u: comment or short line", count_in);
499 continue; 497 continue;
500 } 498 }