summaryrefslogtreecommitdiff
path: root/xmalloc.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-03-26 14:22:47 +1100
committerDamien Miller <djm@mindrot.org>2006-03-26 14:22:47 +1100
commit36812092ecb11a25ca9d6d87fdeaf53e371c5043 (patch)
tree257ccc18998146f7f6e6c25cbb0ff9bd6de946a5 /xmalloc.h
parent07d86bec5eeaf19fe33dca99c8ebcbe9a77c3938 (diff)
downloadopenssh-git-36812092ecb11a25ca9d6d87fdeaf53e371c5043.tar.gz
- djm@cvs.openbsd.org 2006/03/25 01:13:23
[buffer.c channels.c deattack.c misc.c scp.c session.c sftp-client.c] [sftp-server.c ssh-agent.c ssh-rsa.c xmalloc.c xmalloc.h auth-pam.c] [uidswap.c] change OpenSSH's xrealloc() function from being xrealloc(p, new_size) to xrealloc(p, new_nmemb, new_itemsize). realloc is particularly prone to integer overflows because it is almost always allocating "n * size" bytes, so this is a far safer API; ok deraadt@
Diffstat (limited to 'xmalloc.h')
-rw-r--r--xmalloc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmalloc.h b/xmalloc.h
index b6d521a6..ef29787b 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmalloc.h,v 1.10 2006/03/25 00:05:41 djm Exp $ */
+/* $OpenBSD: xmalloc.h,v 1.11 2006/03/25 01:13:23 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -21,7 +21,7 @@
void *xmalloc(size_t);
void *xcalloc(size_t, size_t);
-void *xrealloc(void *, size_t);
+void *xrealloc(void *, size_t, size_t);
void xfree(void *);
char *xstrdup(const char *);
int xasprintf(char **, const char *, ...)