Skip to content

Commit 50cfcf7

Browse files
committed
Proper handling of possible smaller arrays.
1 parent 5eadab9 commit 50cfcf7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Provider/src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbDataReader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ public override int GetValues(object[] values)
412412
CheckState();
413413
CheckPosition();
414414

415-
for (var i = 0; i < _fields.Count; i++)
415+
var count = Math.Min(_fields.Count, values.Length);
416+
for (var i = 0; i < count; i++)
416417
{
417418
values[i] = CheckedGetValue(() => GetValue(i));
418419
}
419-
420-
return values.Length;
420+
return count;
421421
}
422422

423423
public override bool GetBoolean(int i)

0 commit comments

Comments
 (0)