nuttx/libs/libc
Michal Lenc 1e1185c63e libs/libc/obstack/lib_obstack_free.c: fix object check within chunk
The original condition incorrectly used &h->chunk instead of
h->chunk in the calculation whether the object is in the chunk. This
could lead to the wrong behavior as the first branch gave incorrect
result and thus sometimes the entire obstack was freed even though
object was not NULL.

The commit also simplifies the logic, we can use pointer arithmetic
here and just do h->chunk + 1 as it gives the same result as
(FAR char *)h->chunk + sizeof(struct _obstack_chunk). This saves
unnecessary cast and sizeof.

The second branch should be less than or equal, not just less than.
This ensures the object is correctly located in the chunk even after
previous obstack_finish was called.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Karel Kočí <kkoci@elektroline.cz>
2025-12-23 10:28:25 +08:00
..
aio style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
assert libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
audio libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
builtin libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
ctype style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
dirent cmake:refine nuttx cmake build system fix CMake build missing part 2024-10-13 02:25:06 +08:00
dlfcn libs: unify Private Types banners 2025-05-28 10:17:15 +08:00
elf libc/libelf:fix bug for libelf_symname 2025-12-23 10:27:15 +08:00
errno libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
eventfd libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
fdt libs/libc/fdt/Make.defs: cannot move due to directory not empty bugfix 2024-10-09 15:42:17 +08:00
fixedmath libs: unify Private Types banners 2025-05-28 10:17:15 +08:00
gdbstub style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
gnssutils libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
grp libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
hex2bin stream_getc: use lib_stream_eof instead of EOF 2024-11-26 10:25:36 +08:00
inttypes libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
libgen libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
locale style/FAR: remove FAR qualifier 2025-11-10 10:56:29 +01:00
lzf libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
machine libs/libc/arm: add back __aeabi_mem* functions 2025-11-28 14:50:58 -03:00
misc libc/crc: Add crc8rohcincr for incremental CRC8 ROHC calculation 2025-09-30 17:30:46 -03:00
net libs: unify Private Types banners 2025-05-28 10:17:15 +08:00
netdb style/FAR: remove FAR qualifier 2025-11-10 10:56:29 +01:00
obstack libs/libc/obstack/lib_obstack_free.c: fix object check within chunk 2025-12-23 10:28:25 +08:00
pthread libc/pthread/pthread_keydelete.c: reset key value 2025-10-01 12:00:43 +08:00
pwd libs/libc/unistd: add getspnam function 2024-10-16 11:15:25 +08:00
queue libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
regex style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
sched style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
search libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
semaphore sched/semaphore: add support to customize semaphore max allowed value 2025-09-04 09:48:34 +08:00
signal sched/signal: Fix nxsig_ismember() return value behavior 2025-11-25 10:02:52 +08:00
spawn cmake:refine nuttx cmake build system fix CMake build missing part 2024-10-13 02:25:06 +08:00
stdio libc/fclose: Validate the user provided stream pointer 2025-09-09 23:51:35 +08:00
stdlib libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
stream libc: lib_bsprintf reuse var instead value for string 2025-06-20 09:48:39 +08:00
string libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
symtab lib_libvsprintf.c:add option in Kconfig to control "%p*" special format specifier. 2024-10-15 15:33:13 +08:00
syslog drivers/syslog: Add RFC 5424 protocol support 2025-06-13 20:26:57 +08:00
termios libs: unify Private Types banners 2025-05-28 10:17:15 +08:00
time libs: unify Private Types banners 2025-05-28 10:17:15 +08:00
tls libc: Add debug assert to prevent tls allocation failure 2024-10-18 21:34:18 +08:00
uio move readv/writev to the kernel 2024-10-30 17:07:54 +08:00
unistd libc/unistd: Replace pipe() macro with proper function implementation 2025-11-26 17:18:13 +08:00
userfs style/FAR: remove FAR qualifier 2025-11-10 10:56:29 +01:00
uuid libc: Refine the arc4random_buf implementation 2024-10-26 18:04:21 -03:00
wchar style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
wctype libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
wqueue libs: unify Private Types banners 2025-05-28 10:17:15 +08:00
zoneinfo libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
.gitignore libc/elf: rename modlib to libelf 2025-04-11 09:43:22 +08:00
CMakeLists.txt libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
Kconfig libc/elf: rename modlib to libelf 2025-04-11 09:43:22 +08:00
libc.csv libc/unistd: Replace pipe() macro with proper function implementation 2025-11-26 17:18:13 +08:00
libc.h libc/machine:Add prefixes to libc functions implemented by arch 2024-10-31 18:11:16 +08:00
Makefile libc/elf: rename modlib to libelf 2025-04-11 09:43:22 +08:00