pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #3750: Use `BufferedInputStream` with `FileInputStream`
Date: Wed, 06 Aug 2025 15:37:57 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

I've an idea how we could prevent similar issues in the future:

1) Create `org.postgresql.util.internal.IoUtil` class with `BufferedInputStream newBufferedInputStream(File)` method
2) Make sure we use the method whenever we need `new FileInputStream(...)`
3) Add `java.io.FileInputStream#FileInputStream(java.io.File)` and `FileInputStream(String name)` constructors to `forbidden-api.txt`:https://github.com/pgjdbc/pgjdbc/blob/de6023d9b90c0f5d66ed4efb9169cda56b352601/config/forbidden-apis...
4) Exclude `org.postgresql.util.internal.IoUtil` from forbidden-apis check: https://github.com/pgjdbc/pgjdbc/blob/de6023d9b90c0f5d66ed4efb9169cda56b352601/build-logic/verificat...

Then the build would prevent `new FileInputStream` entering to the source code.

WDYT?

view thread (8+ messages)  latest in thread

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: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #3750: Use `BufferedInputStream` with `FileInputStream`
  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