diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-07-14 11:21:23 +0300 |
---|---|---|
committer | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-07-14 11:21:23 +0300 |
commit | 6ce1efb64890cd823e89c1aff2332187f25e90ac (patch) | |
tree | a00347cc5af84ccb74fd957c7cc95c60474d6d43 | |
parent | d2560a1f6e8f0ca21475bc0b11d05741546cf139 (diff) |
Error checking for null host id
-rw-r--r-- | database/sqlite/sqlite_context.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/database/sqlite/sqlite_context.c b/database/sqlite/sqlite_context.c index aa0d286d56..dbe0ba3b13 100644 --- a/database/sqlite/sqlite_context.c +++ b/database/sqlite/sqlite_context.c @@ -138,6 +138,11 @@ void ctx_get_chart_list(uuid_t *host_uuid, void (*dict_cb)(SQL_CHART_DATA *, voi int rc; sqlite3_stmt *res = NULL; + if (unlikely(!host_uuid)) { + internal_error(true, "Requesting context chart list without host_id"); + return; + } + rc = sqlite3_prepare_v2(db_context_meta, CTX_GET_CHART_LIST, -1, &res, 0); if (unlikely(rc != SQLITE_OK)) { error_report("Failed to prepare statement to fetch chart list"); |