Skip to content

Commit a547b55

Browse files
authored
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 14aefca commit a547b55

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
@@ -758,7 +758,7 @@ private static Number textDecodeNUMERIC(int index, int len, ByteBuf buff) {
758758
private static Point textDecodePOINT(int index, int len, ByteBuf buff) {
759759
// Point representation: (x,y)
760760
int idx = ++index;
761-
int s = buff.indexOf(idx, idx + len, (byte) ',');
761+
int s = buff.indexOf(idx, idx + len - 1, (byte) ',');
762762
int t = s - idx;
763763
double x = textDecodeFLOAT8(idx, t, buff);
764764
double y = textDecodeFLOAT8(s + 1, len - t - 3, buff);

0 commit comments

Comments
 (0)