Fix overflow in Windows replacement pg_pread/pg_pwrite.
Thomas Munro <tmunro@postgresql.org>
Fix overflow in Windows replacement pg_pread/pg_pwrite. When calling the Windows file I/O APIs there is an implicit conversion from size_t to DWORD, which could overflow. Clamp the size at 1GB to avoid that. Not a really a live bug as we don't expect anything in PostgreSQL to call with such large values. Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/1672202.1703441340%40sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/port/win32pread.c | modified | +3 −0 |
| src/port/win32pwrite.c | modified | +3 −0 |
Discussion
- pread, pwrite, etc return ssize_t not int 6 messages · 2023-12-24 → 2024-03-02