Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/lib/libc/stdio



Module Name:    src
Committed By:   jdolecek
Date:           Mon Feb  1 17:50:53 UTC 2021

Modified Files:
        src/lib/libc/stdio: fread.3 fread.c fwrite.c

Log Message:
for fread(3) and fwrite(3) check for (size * nmemb) size_t overflow, and
error out with EOVERFLOW if it happens; this is less silly answer
to a silly call than returning some randomly wrapped length

change adapted from OpenBSD

FreeBSD has a similar check, but they return EINVAL instead, feel
free to adjust if SUS or other standard mandates specific value

suggested by Kamil Rytarowski


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/stdio/fread.3
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/stdio/fread.c
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/stdio/fwrite.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index