Subject: Re: CVS commit: src/bin/pax
To: None <christos@NetBSD.org>
From: Kouichirou Hiratsuka <hira@po6.nsk.ne.jp>
List: source-changes
Date: 04/15/2006 01:48:08
At Sat, 18 Mar 2006 05:40:28 +0000 (UTC),
Christos Zoulas wrote:
> 
> 
> Module Name:	src
> Committed By:	christos
> Date:		Sat Mar 18 05:40:28 UTC 2006
> 
> Modified Files:
> 	src/bin/pax: options.c
> 
> Log Message:
> Coverity CID 345: Add missing free's.
> 

tar -T has not worked since this commit.

  % touch a; echo a > list
  % touch b; echo b >> list
  % tar cfz foo.tar.gz a b
  % tar ztf foo.tar.gz -T list
  b
  tar: WARNING! These patterns were not matched:
  b
  %

The problem is caused by line 1201 of bin/pax/options.c (rev 1.95).
pat_add() copies the pointer of the first argument.  The pointed
data are freed before using those.
-- 
 Kouichirou Hiratsuka
   hira@po6.nsk.ne.jp