https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88973

--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #4)
> I've created a test case using the canonicalize_pathname function showing
> that it does, in fact, cause an overlap to take place.  The following line
> in the output of the test case
> 

Thank you very much Martin for it! Btw. ASAN prints nice error about
overlapping arguments:

gcc -DPATHNAME='"/home//marxin"'  -Wall canonicalize_pathname.c
-fsanitize=address -g && ./a.out
=================================================================
==14653==ERROR: AddressSanitizer: strcpy-param-overlap: memory ranges
[0x602000000016,0x60200000001d) and [0x602000000017, 0x60200000001e) overlap
    #0 0x7ffff72051de  (/usr/lib64/libasan.so.5+0x4b1de)
    #1 0x40137c in canonicalize_pathname /tmp/canonicalize_pathname.c:25
    #2 0x401857 in main /tmp/canonicalize_pathname.c:64
    #3 0x7ffff7018b7a in __libc_start_main ../csu/libc-start.c:308
    #4 0x4010e9 in _start (/tmp/a.out+0x4010e9)

Reply via email to