Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 7957531

Browse files
committed
Merge pull request #1940 from stephentoub/fix_bi_overrun
Fix buffer overrun in BigIntegerCalculator.Subtract
2 parents 2a796a9 + 2a66285 commit 7957531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.AddSub.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private unsafe static void Subtract(uint* left, int leftLength,
197197
bits[i] = (uint)digit;
198198
carry = digit >> 32;
199199
}
200-
bits[i] = (uint)carry;
200+
Debug.Assert(carry == 0);
201201
}
202202

203203
[SecuritySafeCritical]

0 commit comments

Comments
 (0)