aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows/handler/exception_handler.cc
diff options
context:
space:
mode:
authornealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-07-30 22:53:09 +0000
committernealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-07-30 22:53:09 +0000
commitf3f7df33de02410699895b5f9a77901b550578cd (patch)
tree7cd2d6848b090cb6eed35425809be160a35f7158 /src/client/windows/handler/exception_handler.cc
parentLinux dumper: Don't record file boundary addresses as null-name SourceFileInf... (diff)
downloadbreakpad-f3f7df33de02410699895b5f9a77901b550578cd.tar.xz
Fix an INVALIDATE_ITERATOR defect reported by Coverity.
std::vector::erase() invalidates the iterator, so we need to advance the iterator by using the return value of erase(). R=nealsid A=wtc git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@370 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows/handler/exception_handler.cc')
-rw-r--r--src/client/windows/handler/exception_handler.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc
index 48900273..be9e5eb2 100644
--- a/src/client/windows/handler/exception_handler.cc
+++ b/src/client/windows/handler/exception_handler.cc
@@ -249,12 +249,12 @@ ExceptionHandler::~ExceptionHandler() {
// TODO(mmentovai): use advapi32!ReportEvent to log the warning to the
// system's application event log.
fprintf(stderr, "warning: removing Breakpad handler out of order\n");
- for (vector<ExceptionHandler*>::iterator iterator =
- handler_stack_->begin();
- iterator != handler_stack_->end();
- ++iterator) {
+ vector<ExceptionHandler*>::iterator iterator = handler_stack_->begin();
+ while (iterator != handler_stack_->end()) {
if (*iterator == this) {
- handler_stack_->erase(iterator);
+ iterator = handler_stack_->erase(iterator);
+ } else {
+ ++iterator;
}
}
}