diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index 3814622f8..cc84dd3d7 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -159,7 +159,7 @@ sqlite_datasource::sqlite_datasource(parameters const& params) { std::vector tables; sqlite_utils::get_tables(dataset_,tables); - if (*table_by_index >= tables.size()) + if (*table_by_index < 0 || *table_by_index >= static_cast(tables.size())) { std::ostringstream s; s << "SQLite Plugin: only "