fortify-headers

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

test_bcopy_dynamic_read.c (289B)


      1 #define _GNU_SOURCE
      2 
      3 #include "common.h"
      4 
      5 #include <strings.h>
      6 
      7 int main(int argc, char** argv) {
      8   char buffer[12] = {0};
      9   bcopy("1234567890", buffer, sizeof(buffer) - 1);
     10   puts(buffer);
     11 
     12   CHK_FAIL_START
     13   bcopy("123456", buffer, argc);
     14   CHK_FAIL_END
     15 
     16   puts(buffer);
     17   return ret;
     18 }