File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ public final class FixConnection implements AutoCloseable
5757
5858 public static final String PROXY_V2_IPV6_SOURCE_IP = "fdaa:bbcc:ddee:0:5e8:349b:d23d:f168" ;
5959 public static final int PROXY_V2_IPV6_SOURCE_PORT = 44858 ;
60+ public static final int CHECKSUM_LENGTH = 3 ;
61+ public static final int TAG10_VALUE_OFFSET = 4 ;
6062
6163 private final ByteBuffer writeBuffer = ByteBuffer .allocateDirect (BUFFER_SIZE );
6264 private final MutableAsciiBuffer writeAsciiBuffer = new MutableAsciiBuffer (writeBuffer );
@@ -427,7 +429,9 @@ public <T extends Decoder> T readMessage(final T decoder)
427429 private static int getEndOfTag10 (final String ascii )
428430 {
429431 final int tag10Index = ascii .indexOf ("\001 10=" );
430- return tag10Index == -1 ? -1 : ascii .indexOf ("\001 " , tag10Index + 4 ) + 1 ;
432+ return tag10Index == -1 || tag10Index + TAG10_VALUE_OFFSET + CHECKSUM_LENGTH > ascii .length () ?
433+ -1 :
434+ ascii .indexOf ("\001 " , tag10Index + TAG10_VALUE_OFFSET ) + 1 ;
431435 }
432436
433437 int pollData () throws IOException
You can’t perform that action at this time.
0 commit comments