Skip to content

Commit

Permalink
Use correct length when obtaining the ocid buffer (java-native-access…
Browse files Browse the repository at this point in the history
…#723)

Motivation:

We need to use the correct calculated length when obtaining the ocid
buffer as otherwise it might fail when operating on a slice

Modifications:

- Use the calculated length

Result:

Don't fail when operating on slices
  • Loading branch information
normanmaurer authored Jun 10, 2024
1 parent 11b9b72 commit f43aa60
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ private QuicheQuicChannel handleServer(ChannelHandlerContext ctx, InetSocketAddr
} else {
scidAddr = Quiche.readerMemoryAddress(dcid);
scidLen = localConnIdLength;
ocidAddr = Quiche.memoryAddress(token, offset, token.readableBytes());
ocidLen = token.readableBytes() - offset;
ocidAddr = Quiche.memoryAddress(token, offset, ocidLen);
// Now create the key to store the channel in the map.
byte[] bytes = new byte[localConnIdLength];
dcid.getBytes(dcid.readerIndex(), bytes);
Expand Down

0 comments on commit f43aa60

Please sign in to comment.