diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2020-05-25 21:21:41 +0200 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2020-05-25 21:21:41 +0200 |
commit | 6857555e47b909076f47a74fa580a26c62f4d791 (patch) | |
tree | 248b295cdeb63c538127b220a02b483a149ae11d | |
parent | a16350f2c0eb4290c3a6324ee0699aba50875c89 (diff) |
fdgrab: replace_str: change strcpy to memmov
strcpy apparently isn't overlap-safe (says ASAN)
-rw-r--r-- | fdgrab.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -14,7 +14,9 @@ static void replace_str(const char *orig, char **arg, char *pattern, char *repla search = out; } memmove(out + (found - search), replace, strlen(replace)); - strcpy(out + (found - search) + strlen(replace), out + (found - search) + strlen(pattern)); + memmove(out + (found - search) + strlen(replace), + out + (found - search) + strlen(pattern), + strlen(out + (found - search) + strlen(pattern)) + 1); } } |