From 89b7e089c42f52c50dba70bb508d8803fa830f0a Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Tue, 31 Jul 2012 00:33:53 +0200 Subject: [PATCH] Fix invalid use of strcpy() on overlapping memory strcpy()'s behavior on overlapping memory is undefined, so replace such uses with memmove(). Based on CTags r783: https://ctags.svn.sourceforge.net/svnroot/ctags@783 --- tagmanager/ctags/ctags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tagmanager/ctags/ctags.c b/tagmanager/ctags/ctags.c index 5a275137..4a4efcf9 100644 --- a/tagmanager/ctags/ctags.c +++ b/tagmanager/ctags/ctags.c @@ -739,13 +739,13 @@ static char* absoluteFilename (const char *file) else if (cp [0] != '/') cp = slashp; #endif - strcpy (cp, slashp + 3); + memmove (cp, slashp + 3, strlen (slashp + 3) + 1); slashp = cp; continue; } else if (slashp [2] == '/' || slashp [2] == '\0') { - strcpy (slashp, slashp + 2); + memmove (slashp, slashp + 2, strlen (slashp + 2) + 1); continue; } }