fortify-headers

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

test_strlcat_dynamic_write.c (334B)


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