alaisi / postgres-async-driver

Asynchronous PostgreSQL Java driver
Apache License 2.0
287 stars 38 forks source link

Error swallowed when message is longer than 255 characters #57

Open RyanHoldren opened 6 years ago

RyanHoldren commented 6 years ago

In ErrorResponseDecoder::read() the temporary buffer is only 255 bytes long, which causes an ArrayIndexOutOfBoundsException whenever the error message is longer than that.

https://github.com/alaisi/postgres-async-driver/blob/71e761c677db1ce1c2b7a57b96a528ace18d61b6/src/main/java/com/github/pgasync/impl/io/ErrorResponseDecoder.java#L55

Unfortunately for me, the out of bounds exception was silently swallowed for some reason - in other words, no error signal from the Observable - which made this was pretty tricky to debug.