summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-12 18:36:30 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-15 22:14:53 -0800
commitb2c6d0d0f64d419590c7cd77aae4890866665cba (patch)
tree2ec4271639bbd93499d3a0389cc02674b9ec3e09
parent897e25de0cf27bd345130912a6da34b0c802a0ca (diff)
downloadxorg-util-makedepend-b2c6d0d0f64d419590c7cd77aae4890866665cba.tar.gz
Bug 56091 - Unsafe use of strcpy() in makedepend
Use memmove for potentially overlapping copies. Reported-by: Laurence Jupp <laurence@narya.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
-rw-r--r--parse.c2
1 files changed, 1 insertions, 1 deletions
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: