summaryrefslogtreecommitdiff
path: root/sftp-server.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 /sftp-server.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 'sftp-server.c')
-rw-r--r--sftp-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sftp-server.c b/sftp-server.c
index cf3458120..a6add52aa 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -712,7 +712,7 @@ process_readdir(void)
712 Stat *stats; 712 Stat *stats;
713 int nstats = 10, count = 0, i; 713 int nstats = 10, count = 0, i;
714 714
715 stats = xmalloc(nstats * sizeof(Stat)); 715 stats = xcalloc(nstats, sizeof(Stat));
716 while ((dp = readdir(dirp)) != NULL) { 716 while ((dp = readdir(dirp)) != NULL) {
717 if (count >= nstats) { 717 if (count >= nstats) {
718 nstats *= 2; 718 nstats *= 2;