ref: 025b7f7df0d8cd7577556a0a3e5d389c54996511
parent: 9f098e0ead1a6be8a47dae73713a61f66da84013
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Jul 1 06:06:31 EDT 2017
[cc1] Change memcpy to memmove in setloc() Setloc() is called with the same string when macros are expanded, and it means that memcpy is called with src = dst.
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -77,7 +77,7 @@
if ((len = strlen(fname)) >= FILENAME_MAX)
die("file name too long: '%s'", fname);
- memcpy(filenam, fname, len);
+ memmove(filenam, fname, len);
filenam[len] = '\0';
free(input->filenam);