Date: Fri, 4 Dec 1998 00:27:20 -0500 (EST) From: "John W. DeBoskey" <jwd@unx.sas.com> To: freebsd-current@FreeBSD.ORG Subject: Bug in pax -s option w/ fix Message-ID: <199812040527.AAA15833@bb01f39.unx.sas.com>
next in thread | raw e-mail | index | archive | help
Hi,
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.
Would someone please review and commit the following patch created
on a 3.0-19981124-SNAP system. I assume that the NET2_REGEX side
is broken also, but I don't have access to a system to fix and test
that variation (what uses NET2_REGEX?).
--- /usr/src/bin/pax/pat_rep.c.old Fri May 15 02:27:44 1998
+++ /usr/src/bin/pax/pat_rep.c Fri Dec 4 00:11:44 1998
@@ -1002,7 +1002,7 @@
# 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'))
Thanks!
John
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812040527.AAA15833>
