From 7c1454e785237cb48de25cad6e2af9f4529da8ee Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 21 May 2021 19:49:03 +0200 Subject: [PATCH] Fix possible crash when removing constraints from table definition This fixes a possible crash when trying to remove a table constraint from a table definition. The issue was introduced in commit 4e1d1ff49ff2d947f4c8b2d7e4808ebb256aae0b. See issue #2670. --- src/sql/sqlitetypes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/sqlitetypes.cpp b/src/sql/sqlitetypes.cpp index c88e0164..84a30e7d 100644 --- a/src/sql/sqlitetypes.cpp +++ b/src/sql/sqlitetypes.cpp @@ -505,7 +505,7 @@ void Table::removeConstraints(const StringVector& vStrFields, Constraint::Constr for(auto it = m_constraints.begin();it!=m_constraints.end();) { if((*it)->columnList() == vStrFields && (*it)->type() == type) - m_constraints.erase(it++); + it = m_constraints.erase(it); else ++it; }