提交 f9ed11f3 编写于 作者: R Rich Felker

posix_memalign should fail if size is not a multiple of sizeof(void *)

上级 47e72e10
......@@ -11,7 +11,7 @@ int posix_memalign(void **res, size_t align, size_t len)
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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册