bcgit / bc-csharp

BouncyCastle.NET Cryptography Library (Mirror)
https://www.bouncycastle.org/csharp
MIT License
1.68k stars 558 forks source link

Fix a wrong delete #545

Open tohidemyname opened 5 months ago

tohidemyname commented 5 months ago

If the returnKey size is more than one, the first deletion will change the index of returnKey.*. The follow-up deletions will delete the wrong items.

peterdettman commented 5 months ago

I see that the removals will cause the check on the "next" entry to be skipped, but I don't see how it could delete wrong items.

In any case, the fix looks good, thanks for reporting the issue.