diff options
author | 2014-10-08 17:35:58 +0000 | |
---|---|---|
committer | 2014-10-08 17:35:58 +0000 | |
commit | 64cf113cfda174a3f12284d623b95b76b54db679 (patch) | |
tree | f03be81fb0b9ec2b0468ad2d40689ed61b83a2c5 /usr.bin/tmux/array.h | |
parent | Use xrealloc(NULL, n, m) instead of xmalloc(n * m) to get overflow (diff) | |
download | wireguard-openbsd-64cf113cfda174a3f12284d623b95b76b54db679.tar.xz wireguard-openbsd-64cf113cfda174a3f12284d623b95b76b54db679.zip |
Add xreallocarray and remove nmemb argument from xrealloc.
Diffstat (limited to 'usr.bin/tmux/array.h')
-rw-r--r-- | usr.bin/tmux/array.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/array.h b/usr.bin/tmux/array.h index e4a9d690bfd..f2887063afa 100644 --- a/usr.bin/tmux/array.h +++ b/usr.bin/tmux/array.h @@ -1,4 +1,4 @@ -/* $OpenBSD: array.h,v 1.6 2012/07/10 11:53:01 nicm Exp $ */ +/* $OpenBSD: array.h,v 1.7 2014/10/08 17:35:58 nicm Exp $ */ /* * Copyright (c) 2006 Nicholas Marriott <nicm@users.sourceforge.net> @@ -39,10 +39,10 @@ fatalx("size too big"); \ if ((a)->space == 0) { \ (a)->space = ARRAY_INITIALSPACE(a); \ - (a)->list = xrealloc((a)->list, 1, (a)->space); \ + (a)->list = xrealloc((a)->list, (a)->space); \ } \ while ((a)->space <= ((a)->num + (n)) * ARRAY_ITEMSIZE(a)) { \ - (a)->list = xrealloc((a)->list, 2, (a)->space); \ + (a)->list = xreallocarray((a)->list, 2, (a)->space); \ (a)->space *= 2; \ } \ } while (0) |