Date: Sun, 14 Jun 2026 12:37:13 +0000 From: Robert Clausecker <fuz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Faraz Vahedi <kfv@kfv.io> Subject: git: 48a47c06c335 - stable/15 - qsort.3: Document mergesort() behaviour on size overflow Message-ID: <6a2ea079.22be6.2478e765@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=48a47c06c335cddbca51cca3134a5e2ad1c4cd95 commit 48a47c06c335cddbca51cca3134a5e2ad1c4cd95 Author: Faraz Vahedi <kfv@kfv.io> AuthorDate: 2026-06-02 09:12:59 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2026-06-14 09:35:23 +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 (cherry picked from commit 26a1180cd1521e4c438ac95a57b134e27ea0a72d) --- 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?6a2ea079.22be6.2478e765>
