diff options
author | Pekka Seppänen <pexu@sourceware.mail.kapsi.fi> | 2023-08-28 14:02:20 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-08-29 14:33:27 +0200 |
commit | 31eb43efa78f8bb67216eec1e7aa0be530360881 (patch) | |
tree | 7c818c59c22e7946625c8efdd63ad31014100150 /newlib/libc/stdlib | |
parent | ca2a4ec243627b19f0ac2c7262703f81712f3be4 (diff) | |
download | newlib-31eb43efa78f8bb67216eec1e7aa0be530360881.zip newlib-31eb43efa78f8bb67216eec1e7aa0be530360881.tar.gz newlib-31eb43efa78f8bb67216eec1e7aa0be530360881.tar.bz2 |
libc/stdlib/nano-mallocr.c, typo in variable name
Nano malloc uses `size' in assertation whereas the correct variable would be
`s'. Given this has existed ever since nano malloc support was added, based
on the context ("returned payload area of desired size does not exceed the
actual allocated chunk") I presume that indeed `s' (user input) and not
`r->size' (computed) shall be used.
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r-- | newlib/libc/stdlib/nano-mallocr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/nano-mallocr.c b/newlib/libc/stdlib/nano-mallocr.c index a2b50fa..41e69ab 100644 --- a/newlib/libc/stdlib/nano-mallocr.c +++ b/newlib/libc/stdlib/nano-mallocr.c @@ -396,7 +396,7 @@ void * nano_malloc(RARG malloc_size_t s) *(long *)((char *)r + offset) = -offset; } - assert(align_ptr + size <= (char *)r + alloc_size); + assert(align_ptr + s <= (char *)r + alloc_size); return align_ptr; } #endif /* DEFINE_MALLOC */ |