From e02014088bf1c566630d48169235dc12f9cd8256 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Thu, 25 Aug 2016 23:50:11 +0300 Subject: [PATCH] Fix the range checks for column indexes in the SQLite module. --- modules/sqlite/Handle/Statement.cpp | 2 +- modules/sqlite/Handle/Statement.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sqlite/Handle/Statement.cpp b/modules/sqlite/Handle/Statement.cpp index 3952dcfc..46aee2f5 100644 --- a/modules/sqlite/Handle/Statement.cpp +++ b/modules/sqlite/Handle/Statement.cpp @@ -88,7 +88,7 @@ Int32 StmtHnd::GetColumnIndex(CSStr name) for (Int32 i = 0; i < mColumns; ++i) { // Get the column name at the current index - CSStr name = (CSStr)sqlite3_column_name(mPtr, i); + CSStr name = static_cast< CSStr >(sqlite3_column_name(mPtr, i)); // Validate the name if (!name) { diff --git a/modules/sqlite/Handle/Statement.hpp b/modules/sqlite/Handle/Statement.hpp index 40e50b4c..a0ae75ea 100644 --- a/modules/sqlite/Handle/Statement.hpp +++ b/modules/sqlite/Handle/Statement.hpp @@ -94,7 +94,7 @@ public: */ bool CheckColumn(Int32 idx) const { - return (idx >= 0) && (idx <= mColumns); + return (idx >= 0) && (idx < mColumns); } /* --------------------------------------------------------------------------------------------