FreeBSD Bugzilla – Attachment 179122 Details for
Bug 202022
bsdgrep -f crash with null pattern
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch to fix -f issue with single null byte for pattern
grep-fnul.patch (text/plain), 457 bytes, created by
Kyle Evans
on 2017-01-20 04:06:24 UTC
(
hide
)
Description:
Proposed patch to fix -f issue with single null byte for pattern
Filename:
MIME Type:
Creator:
Kyle Evans
Created:
2017-01-20 04:06:24 UTC
Size:
457 bytes
patch
obsolete
>diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c >index ecb176df42b..f9e73e011e6 100644 >--- a/usr.bin/grep/grep.c >+++ b/usr.bin/grep/grep.c >@@ -315,7 +315,7 @@ read_patterns(const char *fn) > len = 0; > line = NULL; > while ((rlen = getline(&line, &len, f)) != -1) >- add_pattern(line, line[0] == '\n' ? 0 : (size_t)rlen); >+ add_pattern(line, line[0] == '\0' || line[0] == '\n' ? 0 : (size_t)rlen); > free(line); > if (ferror(f)) > err(2, "%s", fn);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202022
: 179122