28

Use the AddressSanitizer (ASAN)

Enable it like that:

gcc/clang:

$ $CC -fsanitize=address $CFLAGS ...

meson (> 0.55.0):

$ meson compile -Db_sanitize=address ...
#SecureCoding #C/C++
The Address Sanitizer, in short ASAN is useful to detect memory access errors like buffer under-/overflows, use after free or double free in C and C++ during debugging. It can be activated during compile-time with a command-line switch.
Icon with a waving hand

Get in touch

sigma star gmbh
Eduard-Bodem-Gasse 6, 1st floor
6020 Innsbruck | Austria

sigma star gmbh logo