diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2006-03-25 00:05:42 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2006-03-25 00:05:42 +0000 |
commit | 2deaa1649526d4ce68eed29e66d89d32fea75950 (patch) | |
tree | d92b455fbeda76727a52c07da67f7c2fbf210a5e /usr.bin/ssh/sftp-server.c | |
parent | 8748ab126c563a181843be1e20e74225a6c34369 (diff) |
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 'usr.bin/ssh/sftp-server.c')
-rw-r--r-- | usr.bin/ssh/sftp-server.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c index 60c77b08ad2..7ea3eda68c2 100644 --- a/usr.bin/ssh/sftp-server.c +++ b/usr.bin/ssh/sftp-server.c @@ -696,7 +696,7 @@ process_readdir(void) Stat *stats; int nstats = 10, count = 0, i; - stats = xmalloc(nstats * sizeof(Stat)); + stats = xcalloc(nstats, sizeof(Stat)); while ((dp = readdir(dirp)) != NULL) { if (count >= nstats) { nstats *= 2; |