public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thomas Munro <[email protected]>
To: [email protected]
Subject: pgsql: Fix overflow in Windows replacement pg_pread/pg_pwrite.
Date: Sat, 02 Mar 2024 19:47:12 +0000
Message-ID: <[email protected]> (raw)

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 <[email protected]>
Discussion: https://postgr.es/m/1672202.1703441340%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1e013746544bd1f9df70f5547894fd72719c4b85

Modified Files
--------------
src/port/win32pread.c  | 3 +++
src/port/win32pwrite.c | 3 +++
2 files changed, 6 insertions(+)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Fix overflow in Windows replacement pg_pread/pg_pwrite.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox