summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Martin <amartin@witekio.com>2022-10-07 21:08:40 +0200
committerPaul Eggert <eggert@cs.ucla.edu>2022-10-07 15:25:36 -0700
commit7324326b1df67831b39a597eb10f67a5369aa189 (patch)
tree8c1b97ba324e90ae8fa55727a9fe30aaea0b55ae
parent705bb093174004275009510bdaab6e8046ab37f8 (diff)
downloadtar-7324326b1df67831b39a597eb10f67a5369aa189.tar.gz
tar: fix --exclude-vcs-ignores memory
The function frees the patterns' wordsplit structure without asking add_exclude to reallocate the strings. In many cases, this leads to each file name in the directory being checked against the memory location where it just got reallocated. * src/exclist.c: Use EXCLUDE_ALLOC. Copyright-paperwork-exempt: Yes
-rw-r--r--src/exclist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/exclist.c b/src/exclist.c
index 80450bb7..1be08cbe 100644
--- a/src/exclist.c
+++ b/src/exclist.c
@@ -203,6 +203,7 @@ cvs_addfn (struct exclude *ex, char const *pattern, int options, void *data)
struct wordsplit ws;
size_t i;
+ options |= EXCLUDE_ALLOC;
if (wordsplit (pattern, &ws,
WRDSF_NOVAR | WRDSF_NOCMD | WRDSF_SQUEEZE_DELIMS))
return;