diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-18 05:28:47 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-18 05:28:47 +0200 |
commit | b2a8300f515a521f43524df1017d43c6d41a86c3 (patch) | |
tree | a818cb09bf12ee37a5a6e7639a9f784f3d845d0c | |
parent | info typo (diff) | |
download | slibc-b2a8300f515a521f43524df1017d43c6d41a86c3.tar.gz slibc-b2a8300f515a521f43524df1017d43c6d41a86c3.tar.bz2 slibc-b2a8300f515a521f43524df1017d43c6d41a86c3.tar.xz |
rememalign: check mode
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/slibc-alloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/slibc-alloc.c b/src/slibc-alloc.c index 91478c6..e6a294b 100644 --- a/src/slibc-alloc.c +++ b/src/slibc-alloc.c @@ -281,6 +281,9 @@ void* rememalign(void* ptr, size_t boundary, size_t size, enum rememalign_mode m size_t old_size; void* new_ptr; + if ((enum rememalign_mode)(conf_clear | conf_init | conf_memcpy) != mode) + return errno = EINVAL, NULL; + if (size == 0) return secure_free(ptr), NULL; |