aboutsummaryrefslogtreecommitdiff
path: root/stdlib/Makefile
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-12-10 01:21:46 +0000
committerSam James <sam@gentoo.org>2025-01-02 16:47:51 +0000
commitd5bceac99d24af1131b90027dab267e437b65cd1 (patch)
tree6fb637f76ac3a727c3050af608c9701134075fc6 /stdlib/Makefile
parent6f0ea84f17581d13ad668adbc181c37141d389b8 (diff)
downloadglibc-d5bceac99d24af1131b90027dab267e437b65cd1.tar.xz
glibc-d5bceac99d24af1131b90027dab267e437b65cd1.zip
stdlib: random_r: fix unaligned access in initstate and initstate_r [BZ #30584]
The initstate{,_r} interfaces are documented in BSD as needing an aligned array of 32-bit values, but neither POSIX nor glibc's own documentation require it to be aligned. glibc's documentation says it "should" be a power of 2, but not must. Use memcpy to read and write to `state` to handle such an unaligned argument. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'stdlib/Makefile')
-rw-r--r--stdlib/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/stdlib/Makefile b/stdlib/Makefile
index cad1a2e244..374643e753 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -300,6 +300,7 @@ tests := \
tst-rand48-2 \
tst-random \
tst-random2 \
+ tst-random-bz30584 \
tst-realpath \
tst-realpath-toolong \
tst-secure-getenv \