Skip to content
Snippets Groups Projects
Commit 144d6e23 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9782: sdes_negotiator: fix iterator usage and set dangling pointers to 0

parent 94a92a0e
No related branches found
No related tags found
No related merge requests found
...@@ -178,7 +178,7 @@ bool SdesNegotiator::negotiate() ...@@ -178,7 +178,7 @@ bool SdesNegotiator::negotiate()
std::vector<CryptoAttribute *> cryptoAttributeVector = parse(); std::vector<CryptoAttribute *> cryptoAttributeVector = parse();
std::vector<CryptoAttribute *>::iterator iter_offer = cryptoAttributeVector.begin(); std::vector<CryptoAttribute *>::iterator iter_offer = cryptoAttributeVector.begin();
std::vector<CryptoSuiteDefinition>::iterator iter_local = localCapabilities_.begin(); std::vector<CryptoSuiteDefinition>::const_iterator iter_local = localCapabilities_.begin();
bool negotiationSuccess = false; bool negotiationSuccess = false;
...@@ -197,10 +197,11 @@ bool SdesNegotiator::negotiate() ...@@ -197,10 +197,11 @@ bool SdesNegotiator::negotiate()
authTagLength_ = cryptoSuite_.substr(cryptoSuite_.size()-2, 2); authTagLength_ = cryptoSuite_.substr(cryptoSuite_.size()-2, 2);
} }
iter_local++; ++iter_local;
} }
delete(*iter_offer); delete *iter_offer;
iter_offer++; *iter_offer = 0;
++iter_offer;
} }
} catch (const ParseError& exception) { } catch (const ParseError& exception) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment