Use memmove for potentially overlapping copies.

Reported-by: Laurence Jupp <laure...@narya.org>
Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com>
---
 parse.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parse.c b/parse.c
index 2d7c95a..e5240c3 100644
--- a/parse.c
+++ b/parse.c
@@ -229,7 +229,7 @@ deftype (char *line, struct filepointer *filep,
                /*
                 * copy the definition back to the beginning of the line.
                 */
-               strcpy (line, p);
+               memmove (line, p, strlen(p) + 1);
                break;
        case ELSE:
        case ENDIF:
-- 
1.7.9.2

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to