summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-03-26 14:19:21 +1100
committerDamien Miller <djm@mindrot.org>2006-03-26 14:19:21 +1100
commit07d86bec5eeaf19fe33dca99c8ebcbe9a77c3938 (patch)
tree098295eee2d7ec7b116b0db3ac4b580713dd5ab0 /ssh.c
parent7cd4579eb3c5afd22ae24436fd2611cd3aa0150a (diff)
- djm@cvs.openbsd.org 2006/03/25 00:05:41
[auth-bsdauth.c auth-skey.c auth.c auth2-chall.c channels.c] [clientloop.c deattack.c gss-genr.c kex.c key.c misc.c moduli.c] [monitor.c monitor_wrap.c packet.c scard.c sftp-server.c ssh-agent.c] [ssh-keyscan.c ssh.c sshconnect.c sshconnect2.c sshd.c uuencode.c] [xmalloc.c xmalloc.h] introduce xcalloc() and xasprintf() failure-checked allocations functions and use them throughout openssh xcalloc is particularly important because malloc(nmemb * size) is a dangerous idiom (subject to integer overflow) and it is time for it to die feedback and ok deraadt@
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssh.c b/ssh.c
index 0c950745b..f34be679c 100644
--- a/ssh.c
+++ b/ssh.c
@@ -687,7 +687,7 @@ main(int ac, char **av)
687 if (options.rhosts_rsa_authentication || 687 if (options.rhosts_rsa_authentication ||
688 options.hostbased_authentication) { 688 options.hostbased_authentication) {
689 sensitive_data.nkeys = 3; 689 sensitive_data.nkeys = 3;
690 sensitive_data.keys = xmalloc(sensitive_data.nkeys * 690 sensitive_data.keys = xcalloc(sensitive_data.nkeys,
691 sizeof(Key)); 691 sizeof(Key));
692 692
693 PRIV_START; 693 PRIV_START;
@@ -1250,7 +1250,8 @@ env_permitted(char *env)
1250 int i; 1250 int i;
1251 char name[1024], *cp; 1251 char name[1024], *cp;
1252 1252
1253 strlcpy(name, env, sizeof(name)); 1253 if (strlcpy(name, env, sizeof(name)) >= sizeof(name))
1254 fatal("env_permitted: name too long");
1254 if ((cp = strchr(name, '=')) == NULL) 1255 if ((cp = strchr(name, '=')) == NULL)
1255 return (0); 1256 return (0);
1256 1257