Browse Source

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
Aurélien Martin 2 years ago
parent
commit
7324326b1d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/exclist.c

+ 1 - 0
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;