From 0877e56d971b2ac8c881c526485b8197a861a3cf Mon Sep 17 00:00:00 2001 From: Erik Verbruggen <erik.verbruggen@nokia.com> Date: Fri, 4 Jun 2010 10:17:45 +0200 Subject: [PATCH] Fixed possible unsigned overflow. --- src/plugins/cppeditor/cppquickfix.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppquickfix.cpp b/src/plugins/cppeditor/cppquickfix.cpp index 16b0c13a88e..f3d6bc3dc38 100644 --- a/src/plugins/cppeditor/cppquickfix.cpp +++ b/src/plugins/cppeditor/cppquickfix.cpp @@ -922,7 +922,10 @@ int CppQuickFixOperation::endOf(unsigned index) const int CppQuickFixOperation::endOf(const CPlusPlus::AST *ast) const { - return endOf(ast->lastToken() - 1); + if (unsigned end = ast->lastToken()) + return endOf(end - 1); + else + return 0; } void CppQuickFixOperation::startAndEndOf(unsigned index, int *start, int *end) const -- GitLab