From 7324326b1df67831b39a597eb10f67a5369aa189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Martin?= Date: Fri, 7 Oct 2022 21:08:40 +0200 Subject: 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 --- src/exclist.c | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.1