You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
' private static PgpPublicKey RemoveCert(PgpPublicKey key, IUserDataPacket id)
{
PgpPublicKey returnKey = new PgpPublicKey(key);
bool found = false;
for (int i = 0; i <returnKey.ids.Count-1; i++)
{
if (id.Equals(returnKey.ids[i]))
{
found = true;
returnKey.ids.RemoveAt(i);
returnKey.idTrusts.RemoveAt(i);
returnKey.idSigs.RemoveAt(i);
}
}
return found ? returnKey : null;
}'
If returnKey.ids has more than one item, the first deletion will change the indexes of returnKey.*. The follow-up deletions will delete wrong items.
My pull request is as follows:
The code is as follows:
' private static PgpPublicKey RemoveCert(PgpPublicKey key, IUserDataPacket id)
{
PgpPublicKey returnKey = new PgpPublicKey(key);
bool found = false;
}'
If returnKey.ids has more than one item, the first deletion will change the indexes of returnKey.*. The follow-up deletions will delete wrong items.
My pull request is as follows:
#545
The text was updated successfully, but these errors were encountered: