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)
- 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 b6d521a66..ef29787bd 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: xmalloc.h,v 1.10 2006/03/25 00:05:41 djm Exp $ */ 1/* $OpenBSD: xmalloc.h,v 1.11 2006/03/25 01:13:23 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -21,7 +21,7 @@
21 21
22void *xmalloc(size_t); 22void *xmalloc(size_t);
23void *xcalloc(size_t, size_t); 23void *xcalloc(size_t, size_t);
24void *xrealloc(void *, size_t); 24void *xrealloc(void *, size_t, size_t);
25void xfree(void *); 25void xfree(void *);
26char *xstrdup(const char *); 26char *xstrdup(const char *);
27int xasprintf(char **, const char *, ...) 27int xasprintf(char **, const char *, ...)