aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1998-12-05 10:29:10 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1998-12-05 10:29:10 +0000
commitf08c1d5e48bb1cf156c9f265f27cb69c80b2643f (patch)
tree8dec458ceb44d139ef9e3eb8c28baac32000b112 /bin
parenta4dddbe01e7e2bcb18f3de77fe40530d61f60a00 (diff)
downloadsrc-f08c1d5e48bb1cf156c9f265f27cb69c80b2643f.tar.gz
src-f08c1d5e48bb1cf156c9f265f27cb69c80b2643f.zip
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
Notes
Notes: svn path=/head/; revision=41539
Diffstat (limited to 'bin')
-rw-r--r--bin/pax/pat_rep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index f46dce1ea6fa..ac73ec640448 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'))