Skip to content

Commit

Permalink
Fix integer overflow in TDSWriter.writeString() (#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
micheljung authored Mar 25, 2021
1 parent 0fc61a7 commit b15b440
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3940,7 +3940,7 @@ void writeString(String value) throws SQLServerException {
int charsCopied = 0;
int length = value.length();
while (charsCopied < length) {
int bytesToCopy = 2 * (length - charsCopied);
long bytesToCopy = 2 * (length - charsCopied);

if (bytesToCopy > valueBytes.length)
bytesToCopy = valueBytes.length;
Expand Down

0 comments on commit b15b440

Please sign in to comment.