Skip to content

Commit

Permalink
cryptoX509Chain: fix bug in Remove
Browse files Browse the repository at this point in the history
The 'end' pointer was not correctly updated when the last object was removed.
  • Loading branch information
gganis committed Jan 19, 2017
1 parent 78707d1 commit 16a5dc4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/XrdCrypto/XrdCryptoX509Chain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,16 @@ void XrdCryptoX509Chain::Remove(XrdCryptoX509 *c)

// Now we have all the information to remove
if (prev) {
current = curr->Next();
prev->SetNext(current);
previous = curr;
if (curr != end) {
current = curr->Next();
prev->SetNext(current);
previous = prev;
} else {
end = prev;
previous = end;
current = 0;
prev->SetNext(current);
}
} else if (curr == begin) {
// First buffer
current = curr->Next();
Expand Down

0 comments on commit 16a5dc4

Please sign in to comment.