Releases: phil-base/tripwire
Releases · phil-base/tripwire
v0.2.0 — Standard compliance and test infrastructure
What's new
Standard C compatibility
free(NULL)is now a no-op per the C standardrealloc(NULL, size)delegates tomalloc(size)realloc(p, 0)delegates tofree(p)and returnsNULL
Tracker lifecycle
- New
tripwire_cleanup()function frees all internal tracking state - Freed nodes retain history for double-free detection
- Dangling
allocpointers nulled after free
Arithmetic hardening
- Overflow guards on
malloc,calloc, andreallocsize calculations callocdetectsnmemb * sizeoverflow before allocating
Code quality
constcorrectness on allfileparameters- Fixed typos in
realloc/freeerror messages - Sentinel checks added to
free()path
Project infrastructure
- Portable test suite (
test.c, 18 tests) — no POSIX dependency - Fatal-path test suite (
test_fatal.c, 4 tests) — POSIX only make runfor portable tests,make run-allfor full suite- CI matrix: GCC + Clang on Ubuntu and macOS
- Limitations section in README
- MIT license (switched from BSD 2-Clause)
v0.1.0 — Initial release
Lightweight C memory debugging wrapper. Drop in two files, catch buffer overflows, double frees, and leaks.
Features
- Transparent replacement of
malloc,realloc,calloc,strdup,free,memset,memcpy, andmemmovevia preprocessor macros - Sentinel-based buffer overflow and underflow detection
- Double-free and invalid-pointer detection
- Leak reporting via
tripwire_report() - File and line number in all diagnostics
Usage
Copy tripwire.h and tripwire.c into your project, include the header after your standard headers, and compile with tripwire.c. See the README for details.