Skip to content

Commit 751f00c

Browse files
committed
Fix out-of-bounds write.
1 parent bec3544 commit 751f00c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MySqlConnector/MySql.Data.MySqlClient/MySqlBulkCopy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ await dbDataReader.ReadAsync(cancellationToken).ConfigureAwait(false) :
160160
else
161161
shouldAppendSeparator = true;
162162

163-
if (!WriteValue(connection, value, buffer.AsSpan(0, maxLength).Slice(outputIndex), out var bytesWritten))
163+
if (outputIndex >= maxLength || !WriteValue(connection, value, buffer.AsSpan(0, maxLength).Slice(outputIndex), out var bytesWritten))
164164
{
165165
wroteRow = false;
166166
break;

0 commit comments

Comments
 (0)