Skip to content

Commit 8e21944

Browse files
committed
Correct Packet Size check conditions
1 parent 4a35cfc commit 8e21944

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/thin/protocol/messages/withData.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ class MessageWithData extends Message {
450450
if (actualNumBytes !== 0 && colValue !== null) {
451451
errors.throwErr(errors.ERR_INSUFFICIENT_BUFFER_FOR_BINDS);
452452
}
453-
} else if (oraTypeNum === constants.TNS_DATA_TYPE_LONG || oraTypeNum === constants.TNS_DATA_TYPE_LONG_RAW || variable.maxSize >= constants.TNS_MIN_LONG_LENGTH) {
453+
} else if (oraTypeNum === constants.TNS_DATA_TYPE_LONG || oraTypeNum === constants.TNS_DATA_TYPE_LONG_RAW || variable.maxSize > buf.caps.maxStringSize) {
454454
buf.skipSB4(); // null indicator
455455
buf.skipUB4(); // return code
456456
}
@@ -689,9 +689,9 @@ class MessageWithData extends Message {
689689
if (bindInfo.isReturnBind)
690690
continue;
691691
const variable = bindInfo.bindVar;
692-
if (variable.maxSize <= buf.caps.maxStringSize)
693-
continue;
694-
this.writeBindParamsColumn(buf, variable, variable.values[pos + offset]);
692+
if (variable.maxSize > buf.caps.maxStringSize) {
693+
this.writeBindParamsColumn(buf, variable, variable.values[pos + offset]);
694+
}
695695
}
696696
}
697697
}

0 commit comments

Comments
 (0)