]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libc: handle zero alignment in memalign()
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 24 Feb 2023 16:29:01 +0000 (11:29 -0500)
committerEd Maste <emaste@FreeBSD.org>
Fri, 24 Feb 2023 18:19:06 +0000 (13:19 -0500)
commit2c709ee70ade9fd8f77b37917a4169d667dda41d
tree5900682625321ec0084f418b058d11f34bce4b15
parent07ccf71451d7377b1a6f3367f738ce7ddb1f2a24
libc: handle zero alignment in memalign()

For compatibility with glibc. The previous code would trigger a division
by zero in roundup() and terminate.  Instead, just pass through to
malloc() for align == 0.

PR: 269688
Reviewed by: imp, mjg
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/655
lib/libc/gen/memalign.c