projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
47e72e1
)
posix_memalign should fail if size is not a multiple of sizeof(void *)
author
Rich Felker
<dalias@aerifal.cx>
Wed, 29 Jun 2011 23:26:30 +0000
(19:26 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 29 Jun 2011 23:26:30 +0000
(19:26 -0400)
src/malloc/posix_memalign.c
patch
|
blob
|
history
diff --git
a/src/malloc/posix_memalign.c
b/src/malloc/posix_memalign.c
index
ef86260
..
2ae928c
100644
(file)
--- a/
src/malloc/posix_memalign.c
+++ b/
src/malloc/posix_memalign.c
@@
-11,7
+11,7
@@
int posix_memalign(void **res, size_t align, size_t len)
unsigned char *mem, *new, *end;
size_t header, footer;
unsigned char *mem, *new, *end;
size_t header, footer;
- if ((align & -align) != align) return EINVAL;
+ if ((align & -align
& -sizeof(void *)
) != align) return EINVAL;
if (len > SIZE_MAX - align) return ENOMEM;
if (align <= 4*sizeof(size_t)) {
if (len > SIZE_MAX - align) return ENOMEM;
if (align <= 4*sizeof(size_t)) {