Skip to content

Commit

Permalink
Fix ReturnValue.canDecode(…) byte counters.
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Paluch <mpaluch@vmware.com>

[#199]
  • Loading branch information
mp911de committed Jul 19, 2021
1 parent f2e3618 commit e0a41ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/r2dbc/mssql/message/token/ReturnValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ public static boolean canDecode(ByteBuf buffer, boolean encryptionSupported) {
buffer.skipBytes(2);
int nameLength = Decode.asByte(buffer);

if (buffer.readableBytes() < nameLength + /* status */ 1) {
if (buffer.readableBytes() < (nameLength * 2) + /* status */ 1) {
return false;
}

buffer.skipBytes(nameLength + 1);
buffer.skipBytes((nameLength * 2) + 1);

if (!TypeInformation.canDecode(buffer, true)) {
return false;
Expand Down

0 comments on commit e0a41ae

Please sign in to comment.