diff options
author | Jim Meyering <meyering@fb.com> | 2016-02-20 12:50:27 -0800 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2016-02-20 19:43:05 -0800 |
commit | 3ce8b39e3137d3cdcf8cec84dc89788037e76742 (patch) | |
tree | fa7cbd0d0d9b1ca68763a811c8cedb7208a70986 /NEWS | |
parent | 121d63666fed298769a19354e517fd9a7190a3a2 (diff) | |
download | grep-3ce8b39e3137d3cdcf8cec84dc89788037e76742.tar.gz |
grep -z: avoid erroneous match with regexp anchor and \n in text
* src/dfasearch.c (EGexecute): Clear the newline_anchor bit when
eolbyte is not '\n'.
* tests/z-anchor-newline: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Describe it.
Originally reported by Ulrich Mueller in
https://bugs.gentoo.org/show_bug.cgi?id=574662
Reported to us by Sergei Trofimovich as http://debbugs.gnu.org/22655
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -2,6 +2,19 @@ GNU grep NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Bug fixes + + grep -z would match strings it should not. To trigger the bug, you'd + have to use a regular expression including an anchor (^ or $) and a + feature like a range or a backreference, causing grep to forego its DFA + matcher and resort to using re_search. With a multibyte locale, that + matcher could mistakenly match a string containing a newline. + For example, this command: + printf 'a\nb\0' | LC_ALL=en_US.utf-8 grep -z '^[a-b]*b' + would mistakenly match and print all four input bytes. After the fix, + there is no match, as expected. + [bug introduced in grep-2.7] + * Noteworthy changes in release 2.23 (2016-02-04) [stable] |