Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152331066
D13738.id37416.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
697 B
Referenced Files
None
Subscribers
None
D13738.id37416.diff
View Options
Index: usr.bin/patch/inp.c
===================================================================
--- usr.bin/patch/inp.c
+++ usr.bin/patch/inp.c
@@ -213,8 +213,11 @@
/* now scan the buffer and build pointer array */
iline = 1;
i_ptr[iline] = i_womp;
- /* test for NUL too, to maintain the behavior of the original code */
- for (s = i_womp, i = 0; i < i_size && *s != '\0'; s++, i++) {
+ /*
+ * Testing for NUL here actively breaks files that innocently use NUL
+ * for other reasons. mmap(2) succeeded, just scan the whole buffer.
+ */
+ for (s = i_womp, i = 0; i < i_size; s++, i++) {
if (*s == '\n') {
if (iline == lines_allocated) {
if (!reallocate_lines(&lines_allocated))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 15, 5:40 AM (1 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31522230
Default Alt Text
D13738.id37416.diff (697 B)
Attached To
Mode
D13738: patch(1): Don't check for NUL bytes in Plan A
Attached
Detach File
Event Timeline
Log In to Comment