Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 590 Bytes

File metadata and controls

22 lines (13 loc) · 590 Bytes

Fortify Source

Back

The _FORTIFY_SOURCE macro adds compiler time and run time checks for buffer overflows and memory sanity.

gcc -o test test.c -D_FORTIFY_SOURCE=2

Available levels

_FORTIFY_SOURCE=1 _FORTIFY_SOURCE=2 _FORTIFY_SOURCE=3 emits code to check buffer overflows at runtime

At higher levels of fortify source there is a penalty on build size and performance.

References