Date: Sun, 07 Jun 2026 21:00:56 +0000 From: Robert Clausecker <fuz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi <kfv@kfv.io> Subject: git: 26a1180cd152 - main - qsort.3: Document mergesort() behaviour on size overflow Message-ID: <6a25dc08.47998.34baa44e@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=26a1180cd1521e4c438ac95a57b134e27ea0a72d commit 26a1180cd1521e4c438ac95a57b134e27ea0a72d Author: Faraz Vahedi <kfv@kfv.io> AuthorDate: 2026-06-02 09:12:59 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2026-06-07 20:59:19 +0000 qsort.3: Document mergesort() behaviour on size overflow Signed-off-by: Faraz Vahedi <kfv@kfv.io> Pull Request: https://github.com/freebsd/freebsd-src/pull/2243 Reviewed by: fuz MFC after: 1 week --- lib/libc/stdlib/qsort.3 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3 index e2e29e7cf04f..6b09d57524bf 100644 --- a/lib/libc/stdlib/qsort.3 +++ b/lib/libc/stdlib/qsort.3 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 25, 2024 +.Dd June 2, 2026 .Dt QSORT 3 .Os .Sh NAME @@ -362,13 +362,21 @@ functions succeed unless: .It Bq Er EINVAL The .Fa size -argument is zero, or, +argument is zero, the .Fa size argument to .Fn mergesort is less than -.Dq "sizeof(void *) / 2" . +.Dq "sizeof(void *) / 2" , +or +the +.Fa nmemb +and +.Fa size +arguments to +.Fn mergesort +describe an unrepresentable buffer size. .It Bq Er ENOMEM The .Fn heapsorthome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a25dc08.47998.34baa44e>
