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

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Bruce Korb from comment #5)
> (In reply to Martin Sebor from comment #4)
> 
> > canonicalize_pathname.c: In function ‘canonicalize_pathname’:
> > canonicalize_pathname.c:61:2: warning: ‘strcpy’ accessing 1 byte at offsets
> > [0, 9223372036854775807] and [0, 9223372036854775807] may overlap 1 byte at
> > offset 0 [-Wrestrict]
> >    61 |  strcpy( result + start + 1, result + i + 2 );
> >       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > strcpy (0x217f265 = "//bar", 0x217f267 = "bar"): 3
> > /foo/bar
> 
> I have a copy of this code in my project, but I haven't been writing code
> for several years now. How was this fixed? The best fix would be to
> determine the string length and do memmove-s, but that's enough fiddling
> that I'd have to clear cobwebs and spend a mess of time. If someone's
> already done that, ... :)

There's an upstream bug:
https://sourceforge.net/p/autogen/bugs/193/
and I'm working on patch candidate.

Reply via email to