summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-03-26 14:27:57 +1100
committerDamien Miller <djm@mindrot.org>2006-03-26 14:27:57 +1100
commit5f340065fc047741448e814c7c30018e8012293b (patch)
tree617b765cde91204f2b4ba2ba4048520933c61b04
parenta1690d08b4ce6a1a40786048a6299c2b2d60507f (diff)
- deraadt@cvs.openbsd.org 2006/03/25 18:40:14
[ssh-keygen.c] cast strtonum() result to right type
-rw-r--r--ChangeLog5
-rw-r--r--ssh-keygen.c11
2 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 5efa17b7c..b1f0fa654 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -159,6 +159,9 @@
159 - deraadt@cvs.openbsd.org 2006/03/25 18:36:15 159 - deraadt@cvs.openbsd.org 2006/03/25 18:36:15
160 [sshlogin.c sshlogin.h] 160 [sshlogin.c sshlogin.h]
161 nicer size_t and time_t types 161 nicer size_t and time_t types
162 - deraadt@cvs.openbsd.org 2006/03/25 18:40:14
163 [ssh-keygen.c]
164 cast strtonum() result to right type
162 165
16320060325 16620060325
164 - OpenBSD CVS Sync 167 - OpenBSD CVS Sync
@@ -4416,4 +4419,4 @@
4416 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 4419 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
4417 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 4420 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
4418 4421
4419$Id: ChangeLog,v 1.4280 2006/03/26 03:27:35 djm Exp $ 4422$Id: ChangeLog,v 1.4281 2006/03/26 03:27:57 djm Exp $
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 84f13c42f..25c2cfd84 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.141 2006/03/25 13:17:02 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.142 2006/03/25 18:40:14 deraadt Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1075,7 +1075,7 @@ main(int ac, char **av)
1075 "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) { 1075 "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) {
1076 switch (opt) { 1076 switch (opt) {
1077 case 'b': 1077 case 'b':
1078 bits = strtonum(optarg, 768, 32768, &errstr); 1078 bits = (u_int32_t)strtonum(optarg, 768, 32768, &errstr);
1079 if (errstr) 1079 if (errstr)
1080 fatal("Bits has bad value %s (%s)", 1080 fatal("Bits has bad value %s (%s)",
1081 optarg, errstr); 1081 optarg, errstr);
@@ -1162,19 +1162,20 @@ main(int ac, char **av)
1162 rr_hostname = optarg; 1162 rr_hostname = optarg;
1163 break; 1163 break;
1164 case 'W': 1164 case 'W':
1165 generator_wanted = strtonum(optarg, 1, UINT_MAX, &errstr); 1165 generator_wanted = (u_int32_t)strtonum(optarg, 1,
1166 UINT_MAX, &errstr);
1166 if (errstr) 1167 if (errstr)
1167 fatal("Desired generator has bad value: %s (%s)", 1168 fatal("Desired generator has bad value: %s (%s)",
1168 optarg, errstr); 1169 optarg, errstr);
1169 break; 1170 break;
1170 case 'a': 1171 case 'a':
1171 trials = strtonum(optarg, 1, UINT_MAX, &errstr); 1172 trials = (u_int32_t)strtonum(optarg, 1, UINT_MAX, &errstr);
1172 if (errstr) 1173 if (errstr)
1173 fatal("Invalid number of trials: %s (%s)", 1174 fatal("Invalid number of trials: %s (%s)",
1174 optarg, errstr); 1175 optarg, errstr);
1175 break; 1176 break;
1176 case 'M': 1177 case 'M':
1177 memory = strtonum(optarg, 1, UINT_MAX, &errstr); 1178 memory = (u_int32_t)strtonum(optarg, 1, UINT_MAX, &errstr);
1178 if (errstr) { 1179 if (errstr) {
1179 fatal("Memory limit is %s: %s", errstr, optarg); 1180 fatal("Memory limit is %s: %s", errstr, optarg);
1180 } 1181 }