[pgjdbc/pgjdbc] 266ed6: fix: avoid integer overflow when sending large arg...

From: zapov <rikard(at)ngs(dot)hr>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] 266ed6: fix: avoid integer overflow when sending large arg...
Date: 2017-10-24 13:23:41
Message-ID: 59ef3edd2a7b8_204b3fb77291dc3c725a1@hookshot-fe6-cp1-prd.iad.github.net.mail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 266ed61b30e89c2840b7967a8af7ac8ab86407ff
https://github.com/pgjdbc/pgjdbc/commit/266ed61b30e89c2840b7967a8af7ac8ab86407ff
Author: zapov <rikard(at)ngs(dot)hr>
Date: 2017-10-24 (Tue, 24 Oct 2017)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/core/Utils.java
M pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java
A pgjdbc/src/test/java/org/postgresql/test/jdbc4/LogTest.java

Log Message:
-----------
fix: avoid integer overflow when sending large arguments (#946)

If an argument is larger than 200MB it would overflow during escaping due to optimistic size estimation.
Change size estimation so it works for even larger arguments until StringBuilder crashes with negative size error.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barnabas Bodnar 2017-10-25 11:08:31 [pgjdbc/pgjdbc] 8f5e24: fix: don't attempt to read a SQLXML more than once...
Previous Message AlexElin 2017-10-24 13:02:08 [pgjdbc/pgjdbc] 761882: refactor: state of PGXAConnection as enum (#966)