<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/diff, branch releng/14.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-11T06:14:50Z</updated>
<entry>
<title>diff: Report I/O errors in Stone algorithm</title>
<updated>2026-02-11T06:14:50Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T17:41:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3c10ed2ba3aaef386e57e6078d6d8421429a55d7'/>
<id>urn:sha1:3c10ed2ba3aaef386e57e6078d6d8421429a55d7</id>
<content type='text'>
In the legacy Stone algorithm, we do a first pass over the files to
check if they're identical before we start diffing them.  That code
would correctly set the exit status if an I/O error was encountered,
but would not emit an error message.  Do so.

Approved by:	re (cperciva)
PR:		292198
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj
Differential Revision:	https://reviews.freebsd.org/D55125

(cherry picked from commit f8c12e6e3874cdd353fb16785da6f4e7eb134cd9)
(cherry picked from commit 37ceb8794c22d88a41e261d23d347bc7ac08b2c8)
</content>
</entry>
<entry>
<title>diff: Correctly declare tests</title>
<updated>2026-02-11T06:14:46Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T16:21:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7cf7c711d979fe06e58acade08e6b5e5f460e4c8'/>
<id>urn:sha1:7cf7c711d979fe06e58acade08e6b5e5f460e4c8</id>
<content type='text'>
Approved by:	re (cperciva)
Sponsored by:	Klara, Inc.
Fixes:		5fc739eb5949 ("diff: Fix integer overflows in Stone algorithm")
Fixes:		270492602b9b ("diff: Add test case for pagination resource leak")
Fixes:		590126789c84 ("diff: Don't compare a file or directory to itself")

(cherry picked from commit 157d6664aeb815db3b758bd3038fd1512a0f4e2c)
(cherry picked from commit b8bcf04d6dd37308834ee258230082ae6875b1f3)
</content>
</entry>
<entry>
<title>diff: Don't compare a file or directory to itself</title>
<updated>2026-02-11T06:14:30Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b4139147bbb7e368316bee86ffac0fdb79319839'/>
<id>urn:sha1:b4139147bbb7e368316bee86ffac0fdb79319839</id>
<content type='text'>
While here, stop abusing struct dirent for something we don't even need
to store.

Approved by:	re (cperciva)
PR:		254455
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj, kevans
Differential Revision:	https://reviews.freebsd.org/D55113

(cherry picked from commit 590126789c841d80655869bc075c8980c173dd1c)

diff: Fix build

rc must be defined first.

Fixes:		590126789c84
MFC after:	1 week
X-MFC with:	590126789c84

(cherry picked from commit ee44ab936e84bacaa49847d36aabdf280f9fecce)
(cherry picked from commit 7f412c6f88edc3aafb53a83f1743ad49da4679a9)
</content>
</entry>
<entry>
<title>diff: Fix pagination leak</title>
<updated>2026-02-11T06:14:26Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6761e555376e375f89fe36c72f2813f5e64a7f63'/>
<id>urn:sha1:6761e555376e375f89fe36c72f2813f5e64a7f63</id>
<content type='text'>
* Drop an unnecessary variable and rename pidfd to procd.

* Rewinding stdout serves no purpose, so stop doing it.

* Don't bother freeing memory or setting the global status right
  before erroring out.

* Error out if dup(2) or dup2(2) fail.

* In the unlikely case that our pipe is equal to stdout, we need to
  record that information so we don't close it when cleaning up.

* Don't bother closing a descriptor before dup2(2)ing to it.

* Don't forget to close the the process descriptor after reaping the
  child process.

Approved by:	re (cperciva)
PR:		266592
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, markj
Differential Revision:	https://reviews.freebsd.org/D55112

(cherry picked from commit c3904a7de78ca1ca15fcdf4c09f9d4be7f6fe6f5)
(cherry picked from commit 144455c333dc0d3db369596038de2e3dd6113b46)
</content>
</entry>
<entry>
<title>diff: Add test case for pagination resource leak</title>
<updated>2026-02-11T06:14:23Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2434f3b279a90f9a47a963d5898eea610a94f6e0'/>
<id>urn:sha1:2434f3b279a90f9a47a963d5898eea610a94f6e0</id>
<content type='text'>
The pagination code leaks either processes or descriptors or both,
depending on the exact version of the code you have.  Add a test case
which exercises this leak to facilitate fixing it.

Approved by:	re (cperciva)
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj, kevans
Differential Revision:	https://reviews.freebsd.org/D55111

(cherry picked from commit 270492602b9bd8b8fce4f021f055804978bf3f23)
(cherry picked from commit 51c2384ce049ec92e07901cf8a84c171e5d72104)
</content>
</entry>
<entry>
<title>diff: Fix integer overflows in Stone algorithm</title>
<updated>2026-02-11T06:14:04Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=238bf5ebf68429654caea62f00cb307d37c2a6bb'/>
<id>urn:sha1:238bf5ebf68429654caea62f00cb307d37c2a6bb</id>
<content type='text'>
Fix integer overflows that may occur when the context window is very
large and add tests to exercise those conditions.

Approved by:	re (cperciva)
PR:		267032
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj, kevans
Differential Revision:	https://reviews.freebsd.org/D55110

(cherry picked from commit 5fc739eb5949620da911db2f87ca8faedc549d3a)
(cherry picked from commit 237fd8dd96979412dd65ce95032aa9957463d069)
</content>
</entry>
<entry>
<title>libc: Rename fscandir{,_b}() to fdscandir{,_b}().</title>
<updated>2026-02-05T14:47:46Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-06-23T13:02:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=35f8b56a41230f5c0853c2e096af72e9e65fa0e5'/>
<id>urn:sha1:35f8b56a41230f5c0853c2e096af72e9e65fa0e5</id>
<content type='text'>
This seems to fit the pattern better (e.g. fdopendir()).

I've added weak references to ease the transition, but since it's only
been a few days, we can remove them (and the ObsoleteFiles entries for
the manual pages) before we branch stable/15.

Fixes:		deeebfdecab5
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D50980

(cherry picked from commit 0a5b763d98b921f921243525ff25a70bbe00cfaa)

libc: Finish removing fscandir{,_b}().

These only existed for a few days before being renamed, so there's no
reason to continue to carry compatibility shims for them.

Fixes:		deeebfdecab5
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D50981

(cherry picked from commit ccf937320a1a7383a2c33698007b7244f66dc022)
</content>
</entry>
<entry>
<title>diff: Fix gcc build.</title>
<updated>2026-02-05T14:47:46Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-06-20T15:30:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c7582d56d29f072b4b18c90569b596d2b37f6b12'/>
<id>urn:sha1:c7582d56d29f072b4b18c90569b596d2b37f6b12</id>
<content type='text'>
Sponsored by:	Klara, Inc.

(cherry picked from commit 28d9586cde8dc783f7b698b10c2b564fde14ae74)
</content>
</entry>
<entry>
<title>diff: Detect loops when diffing directories.</title>
<updated>2026-02-05T14:47:46Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-06-20T11:10:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e8009e02e967618c58a033ace838561ba3400d38'/>
<id>urn:sha1:e8009e02e967618c58a033ace838561ba3400d38</id>
<content type='text'>
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D50936

(cherry picked from commit 42092e1b6625b8226de5f34d22b9a96c713626cb)
</content>
</entry>
<entry>
<title>diff: Fix integer overflow.</title>
<updated>2024-08-01T16:15:57Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-07-29T14:02:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ea68175b07e0cd8e51249d2858749481352aa553'/>
<id>urn:sha1:ea68175b07e0cd8e51249d2858749481352aa553</id>
<content type='text'>
The legacy Stone algorithm uses `int` to represent line numbers, array
indices, and array lengths.  If given inputs approaching `INT_MAX` lines,
it would overflow and attempt to allocate ridiculously large amounts of
memory.  To avoid this without penalizing non-pathological inputs,
switch a few variables to `size_t` and add checks while and immediately
after reading both inputs.

MFC after:	3 days
PR:		280371
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D46169

(cherry picked from commit 9317242469f1ca682626d9806f8caf65d143c09a)
</content>
</entry>
</feed>
