diff options
author | obrien <obrien@FreeBSD.org> | 1998-12-05 10:29:10 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1998-12-05 10:29:10 +0000 |
commit | 97f6d04b8b60399af968f4baf1d3e50ff0bc6454 (patch) | |
tree | 63fc7b639af154ab73f0e51264083675cedda0fc /bin/pax | |
parent | dd65c36c59167d37de040e4dface0db0e9ba70cf (diff) | |
download | FreeBSD-src-97f6d04b8b60399af968f4baf1d3e50ff0bc6454.zip FreeBSD-src-97f6d04b8b60399af968f4baf1d3e50ff0bc6454.tar.gz |
There is a bug in /bin/pax -s option processing. The code assumes that all
pattern matches will occur at offset zero of the source string. The bug causes
the input source string pointer to be incremented by the offset of the end of
the match, instead of it's length. The fix is to only increment the pointer by
the length of the pattern match (eo-so).
Of course, the one example in the man page shows a situation where the match
occurs at offset 0.
Submitted by: John W. DeBoskey <jwd@unx.sas.com>
Obtained from: freebsd-current@freebsd.org
Diffstat (limited to 'bin/pax')
-rw-r--r-- | bin/pax/pat_rep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c index f46dce1..ac73ec6 100644 --- a/bin/pax/pat_rep.c +++ b/bin/pax/pat_rep.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94"; #endif static const char rcsid[] = - "$Id$"; + "$Id: pat_rep.c,v 1.12 1998/05/15 06:27:44 charnier Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -1002,7 +1002,7 @@ rep_name(name, nlen, prnt) # ifdef NET2_REGEX inpt = pt->rcmp->endp[0]; # else - inpt += pm[0].rm_eo; + inpt += pm[0].rm_eo - pm[0].rm_so; # endif if ((outpt == endpt) || (*inpt == '\0')) |