提交 598a0147 编写于 作者: R Rich Felker

fix simple_malloc malloc(0) behavior not to return non-unique pointers

上级 a23baf58
......@@ -15,6 +15,7 @@ void *__simple_malloc(size_t n)
static int lock;
size_t align=1;
if (!n) return 0;
if (n > SIZE_MAX/2) goto toobig;
while (align<n && align<ALIGN)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册