Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1/* an example that should be protected by FORTIFY_SOURCE=2 but 2 * not FORTIFY_SOURCE=1 */ 3#include <stdio.h> 4#include <string.h> 5 6struct buffer_with_pad { 7 char buffer[7]; 8 char pad[25]; 9}; 10 11int main(int argc, char *argv[]) { 12 struct buffer_with_pad b; 13 strcpy(b.buffer, argv[1]); 14 puts(b.buffer); 15 return 0; 16}