summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authordjm <djm>2006-03-26 03:19:21 +0000
committerdjm <djm>2006-03-26 03:19:21 +0000
commit02eed99ef7f2174344b2a099b5ff4d93a3d5f0f5 (patch)
tree3c29a0454bc7ad8a196b13ac3701a96859eebc1c /packet.c
parent1f9e006cae2d7883dee6850c5f969ceffcab05f8 (diff)
downloadopenssh-02eed99ef7f2174344b2a099b5ff4d93a3d5f0f5.tar.gz
- 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 'packet.c')
-rw-r--r--packet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/packet.c b/packet.c
index 0121f8ae..40c6b1d2 100644
--- a/packet.c
+++ b/packet.c
@@ -877,7 +877,7 @@ packet_read_seqnr(u_int32_t *seqnr_p)
char buf[8192];
DBG(debug("packet_read()"));
- setp = (fd_set *)xmalloc(howmany(connection_in+1, NFDBITS) *
+ setp = (fd_set *)xcalloc(howmany(connection_in+1, NFDBITS),
sizeof(fd_mask));
/* Since we are blocking, ensure that all written packets have been sent. */
@@ -1419,7 +1419,7 @@ packet_write_wait(void)
{
fd_set *setp;
- setp = (fd_set *)xmalloc(howmany(connection_out + 1, NFDBITS) *
+ setp = (fd_set *)xcalloc(howmany(connection_out + 1, NFDBITS),
sizeof(fd_mask));
packet_write_poll();
while (packet_have_data_to_write()) {