fakechroot icon indicating copy to clipboard operation
fakechroot copied to clipboard

The strcpy writes the terminating null byte as well.

Open adelton opened this issue 5 years ago • 0 comments

Addressing

tmpnam.c:48:5: warning: ‘strcpy’ writing one too many bytes into a region of a size that depends on ‘strlen’ [-Wstringop-overflow=]
   48 |     strcpy(ptr2, ptr);
      |     ^~~~~~~~~~~~~~~~~
tmpnam.c:45:12: note: at offset 0 to an object allocated by ‘malloc’ here
   45 |     ptr2 = malloc(strlen(ptr));
      |            ^~~~~~~~~~~~~~~~~~~
  CCLD     libfakechroot.la

adelton avatar Nov 27 '20 10:11 adelton