Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jan 2017 00:09:38 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 175314] [regression] bsdgrep(1) broken multidot escaping since r225435
Message-ID:  <bug-175314-8-hWBumLF6sY@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-175314-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-175314-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D175314

Kyle Evans <bsdports@kyle-evans.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bsdports@kyle-evans.net

--- Comment #1 from Kyle Evans <bsdports@kyle-evans.net> ---
Created attachment 179167
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D179167&action=
=3Dedit
Proposed patch to address bsdgrep abusing memory

This was irritating to track down. There were two major problems here:

1.) wescmap was being built on top of uninitialized memory -- therefore, ev=
ery
dot was theoretically escaped with junk=3Dtrue
2.) The pre-processed pattern never makes it to fg->pattern, so escmap (also
uninitialized memory) was being built based on the processed pattern (witho=
ut
escapes)

This caused mass-hilarity and there's no way this could have worked since
import. Attached patch addresses both issues by switching both xmalloc()'s =
to
xcalloc and making a copy of the original pat (sans start marker at least) =
to
examine for escapes.

I also touched formatting a bit in the area that I had to make more changes=
 to,
because it was difficult to parse through at first.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-175314-8-hWBumLF6sY>