Skip to content

Commit 53a179c

Browse files
committed
Fix ReturnValue.canDecode(…) byte counters.
Signed-off-by: Mark Paluch <mpaluch@vmware.com> [#199]
1 parent 06f3687 commit 53a179c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/io/r2dbc/mssql/message/token/ReturnValue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ public static boolean canDecode(ByteBuf buffer, boolean encryptionSupported) {
126126
buffer.skipBytes(2);
127127
int nameLength = Decode.asByte(buffer);
128128

129-
if (buffer.readableBytes() < nameLength + /* status */ 1) {
129+
if (buffer.readableBytes() < (nameLength * 2) + /* status */ 1) {
130130
return false;
131131
}
132132

133-
buffer.skipBytes(nameLength + 1);
133+
buffer.skipBytes((nameLength * 2) + 1);
134134

135135
if (!TypeInformation.canDecode(buffer, true)) {
136136
return false;

0 commit comments

Comments
 (0)