TBOX is a glib-like cross-platform C library that is simple to use yet
powerful in nature.
The project focuses on making C development easier and provides many
modules (.e.g stream, coroutine, regex, container, algorithm ...), so
that any developer can quickly pick it up and enjoy the productivity
boost when developing in C language.
devel/tbox: fix data corruption in tb_ralloc() crossing the 128 KiB mmap
threshold
devel/tbox 1.8.0's tb_native_large_allocator_ralloc() corrupts data when a
reallocation crosses TB_VIRTUAL_MEMORY_DATA_MINN (128 KiB) in either
direction. In the malloc<->mmap crossover paths the block is copied with
tb_memcpy_(data, data_head, base_head->size);
The copy starts at the block header (data_head) but the length is the payload
size only. On grow, the last sizeof(tb_native_large_data_head_t) (24) bytes
of user data are silently lost; on shrink, the copy overruns the smaller
destination allocation (heap buffer overflow).
User-visible fallout: devel/xmake-io is completely broken — its Lua loader
reads script files through a tb_buffer, and for any file > 64 KiB the growth
(Only the first 15 lines of the commit message are shown above )
devel/tbox: Glib-like multi-platform c library
TBOX is a glib-like cross-platform C library that is simple to use yet
powerful in nature.
The project focuses on making C development easier and provides many
modules (.e.g stream, coroutine, regex, container, algorithm ...), so
that any developer can quickly pick it up and enjoy the productivity
boost when developing in C language.
WWW: https://docs.tboox.org/
PR: 284724