Summary: | awk mishandles [[:cntrl:]] | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | eggert | ||||
Component: | bin | Assignee: | Andrey A. Chernov <ache> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | ache, kd-dev | ||||
Priority: | --- | Keywords: | patch | ||||
Version: | 9.1-RELEASE | Flags: | ache:
mfc-stable11+
ache: mfc-stable10+ ache: mfc-stable9+ |
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
eggert
2014-12-08 01:09:36 UTC
Created attachment 174328 [details]
Skip NUL to avoid preemptive truncation
The NUL character in cntrl is truncates the pattern, and an empty
pattern matches anything. The attached patch skips NUL as a quick fix.
A commit references this bug: Author: ache Date: Sat Sep 3 23:04:56 UTC 2016 New revision: 305365 URL: https://svnweb.freebsd.org/changeset/base/305365 Log: The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as a quick fix. PR: 195792 Submitted by: kdrakehp@zoho.com Approved by: bwk@cs.princeton.edu (the author) MFC after: 3 days Changes: head/contrib/one-true-awk/b.c A commit references this bug: Author: ache Date: Tue Sep 6 00:32:34 UTC 2016 New revision: 305447 URL: https://svnweb.freebsd.org/changeset/base/305447 Log: MFC r305365 The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as a quick fix. PR: 195792 Submitted by: kdrakehp@zoho.com Approved by: bwk@cs.princeton.edu (the author) Changes: _U stable/10/ stable/10/contrib/one-true-awk/b.c A commit references this bug: Author: ache Date: Tue Sep 6 00:33:54 UTC 2016 New revision: 305448 URL: https://svnweb.freebsd.org/changeset/base/305448 Log: MFC r305365 The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as a quick fix. PR: 195792 Submitted by: kdrakehp@zoho.com Approved by: bwk@cs.princeton.edu (the author) Changes: _U stable/11/ stable/11/contrib/one-true-awk/b.c A commit references this bug: Author: ache Date: Tue Sep 6 00:53:21 UTC 2016 New revision: 305450 URL: https://svnweb.freebsd.org/changeset/base/305450 Log: MFC r305365 The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as a quick fix. PR: 195792 Submitted by: kdrakehp@zoho.com Approved by: bwk@cs.princeton.edu (the author) Changes: _U stable/9/ _U stable/9/contrib/ _U stable/9/contrib/one-true-awk/ stable/9/contrib/one-true-awk/b.c |