fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

test_strncat_dynamic_write.c (262B)


      1 #include "common.h"
      2 
      3 #include <string.h>
      4 
      5 int main(int argc, char** argv) {
      6   char buffer[8] = {0};
      7   strncat(buffer, "1234567", 5);
      8   puts(buffer);
      9 
     10 #if 0
     11   CHK_FAIL_START
     12   strncat(buffer, argv[1], argc);
     13   CHK_FAIL_END
     14 #endif
     15 
     16   puts(buffer);
     17   return ret;
     18 }