<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/patch/inp.c, branch releng/12.2</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.2</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.2'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2018-01-11T15:01:48Z</updated>
<entry>
<title>patch(1): Don't check for NUL bytes in Plan A</title>
<updated>2018-01-11T15:01:48Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-01-11T15:01:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=21ab148d783814f0157935e3fd210b2f22cdb00f'/>
<id>urn:sha1:21ab148d783814f0157935e3fd210b2f22cdb00f</id>
<content type='text'>
Plan A mmap()'s the entire input file and operates on it in memory. The
map(2) call succeeded, so we shouldn't need to bother checking for the NUL
byte as long as we're within our buffer space.

This was clearly intentional to match "the behavior of the original code",
but it creates a discrepancy between Plan A and Plan B that doesn't seem
sensible and it's not inherently wrong to allow a NUL byte.

This change was motivated by the gemspec in net/rubygem-grpc failing to
patch, despite the patch being generated with diff, because a NUL byte was
used as a delimiter in the header briefly in an otherwise text file.

An alternative was considered: to fallback to plan B if plan A won't process
the entire file due to a NUL byte, but I deemed this to be the better option
since plan A isn't failing due to memory limitations and will fail later on
if it's really dealing with a file it shouldn't be.

PR:		224842 (exp-run)
Reported by:	swills
Reviewed by:	emaste, pfg
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D13738
</content>
</entry>
<entry>
<title>bc/dc/patch: make some use of reallocarray(3).</title>
<updated>2017-03-05T16:10:35Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-03-05T16:10:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=63433bc937051f84486b603e9803597db68f796b'/>
<id>urn:sha1:63433bc937051f84486b603e9803597db68f796b</id>
<content type='text'>
reallocarray(3) is a non portable extension from OpenBSD. Given that it is
already in FreeBSD, make easier future merges by adopting in some cases
where the code has some shared heritage with OpenBSD.

Obtained from:	OpenBSD
</content>
</entry>
<entry>
<title>Remove automatic checkout feature.</title>
<updated>2015-08-15T00:42:33Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2015-08-15T00:42:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e678759c309d8840ca620c77e6a6668b704c3220'/>
<id>urn:sha1:e678759c309d8840ca620c77e6a6668b704c3220</id>
<content type='text'>
Obtained from:	DragonFly via OpenBSD
Relnotes:	yes
MFC:		never
</content>
</entry>
<entry>
<title>Use __DECONST instead of doing strdup/free.</title>
<updated>2015-08-11T05:58:33Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2015-08-11T05:58:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=812aa46f45a7ae508a72c5484d190b01f6ee8f19'/>
<id>urn:sha1:812aa46f45a7ae508a72c5484d190b01f6ee8f19</id>
<content type='text'>
Suggested by:	ed
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>use posix_spawn(3) instead of fork() and exec() manually as suggested</title>
<updated>2015-08-10T21:31:50Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2015-08-10T21:31:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2cf624f68a6208facda1dc42ed5e06e9defb442e'/>
<id>urn:sha1:2cf624f68a6208facda1dc42ed5e06e9defb442e</id>
<content type='text'>
by jmg@.

Reviewed By:	pfg
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D3353
</content>
</entry>
<entry>
<title>Fix shell injection vulnerability in patch(1) and drop SCCS</title>
<updated>2015-07-28T19:58:36Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2015-07-28T19:58:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1e3e581593b6484569a2e6570329db4e2306f6cf'/>
<id>urn:sha1:1e3e581593b6484569a2e6570329db4e2306f6cf</id>
<content type='text'>
support by replacing system() with execve().

Future revisions may remove the functionality completely.

Obtained from:	Bitrig
Security:	CVE-2015-1416
</content>
</entry>
<entry>
<title>patch(1): small include changes.</title>
<updated>2015-04-20T22:15:18Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-04-20T22:15:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=df6e4074c09bdc4e6da079bf9f0a03dffd42b482'/>
<id>urn:sha1:df6e4074c09bdc4e6da079bf9f0a03dffd42b482</id>
<content type='text'>
Mostly to match OpenBSD, no functional change.

Obtained from:	OpenBSD
</content>
</entry>
<entry>
<title>patch: Bring small updates from OpenBSD</title>
<updated>2015-04-07T18:06:46Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2015-04-07T18:06:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a45060f0cc6ef3d1dfdbd64afcdb97ca5e17099c'/>
<id>urn:sha1:a45060f0cc6ef3d1dfdbd64afcdb97ca5e17099c</id>
<content type='text'>
Prevent null pointer dereference on empty input files when diff requires
a specific version.

Fix division by zero for files with long lines (&gt; 1024) in Plan B mode
by supporting arbitrarily long lines.

Obtained from:	OpenBSD (CVS Rev 1.41, 1.42)
MFC after:	1 week
</content>
</entry>
<entry>
<title> - Refresh code with latest OpenBSD revisions.</title>
<updated>2013-01-29T20:05:16Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2013-01-29T20:05:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e56ef7d3586d1dea57990c7d94e260b54423ffc3'/>
<id>urn:sha1:e56ef7d3586d1dea57990c7d94e260b54423ffc3</id>
<content type='text'>
 - Remove $DragonFly$ tags as they are using git nowadays and VCS tags will
   not help merging.
 - Other changes to Copyright headers to make them consistent with other
   source code, we intend to fork from this point.

Reviewed by:	pfg
</content>
</entry>
<entry>
<title>- Add a BSD-licensed patch, ported by Pedro F. Giffuni (pfg) from</title>
<updated>2013-01-29T17:03:18Z</updated>
<author>
<name>Gabor Kovesdan</name>
<email>gabor@FreeBSD.org</email>
</author>
<published>2013-01-29T17:03:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2dd076b84bb1129d0a62b886a4e736a9344b3376'/>
<id>urn:sha1:2dd076b84bb1129d0a62b886a4e736a9344b3376</id>
<content type='text'>
  DragonflyBSD and install it as bsdpatch.  WITH_BSD_PATCH makes it
  default and installs GNU patch as gnupatch.

Submitted by:	pfg
Obtained from:	The DragonflyBSD Project
</content>
</entry>
</feed>
