Skip to content

Commit 15e756c

Browse files
committed
IndexOutOfBoundsException when decoding Pg Point (text mode) (#1598)
See #1597 The calculated indexTo cannot be bigger than the buffer capacity Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent d888ffe commit 15e756c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

vertx-pg-client/src/main/java/io/vertx/pgclient/impl/codec/DataTypeCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ private static Number textDecodeNUMERIC(int index, int len, ByteBuf buff) {
760760
private static Point textDecodePOINT(int index, int len, ByteBuf buff) {
761761
// Point representation: (x,y)
762762
int idx = ++index;
763-
int s = buff.indexOf(idx, idx + len, (byte) ',');
763+
int s = buff.indexOf(idx, idx + len - 1, (byte) ',');
764764
int t = s - idx;
765765
double x = textDecodeFLOAT8(idx, t, buff);
766766
double y = textDecodeFLOAT8(s + 1, len - t - 3, buff);

0 commit comments

Comments
 (0)