HomeFreeBSD

libc: fix access mode tests in fmemopen(3)

Description

libc: fix access mode tests in fmemopen(3)

Previously a stream opened as read-only could be written to. Add a test
case for the fix.

Also correct another incorrect access mode check that worked by
accident, and improve the tests for that.

PR: 281953
Reported by: Erkki Moorits, fuz
Reviewed by: fuz, khng (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47265

(cherry picked from commit 0953460ce149e6f384aafbcb1e6213dfbf8f6a16)
(cherry picked from commit 6b9f7133aba44189d9625c352bc2c2a59baf18ef)

Details

Provenance
emasteAuthored on Oct 23 2024, 1:41 PM
Reviewer
fuz
Differential Revision
D47265: libc: fix WRONLY/RDONLY test in fmemopen
Parents
rG1af027e583ec: lib/libcrypt: use explicit_bzero() to clear sensitive buffers
Branches
Unknown
Tags
Unknown