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