0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-17 11:12:42 +00:00

Fix a parameter binding issue when storing chart names in the database ()

This commit is contained in:
Stelios Fragkakis 2021-03-08 11:32:08 +02:00 committed by GitHub
parent 1160fe5436
commit 790af9620f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-3.0-or-later
AUTOMAKE_OPTIONS = subdir-objects
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in

View file

@ -530,11 +530,12 @@ int sql_store_chart(
goto bind_fail;
param++;
if (name) {
if (name && *name)
rc = sqlite3_bind_text(res, 5, name, -1, SQLITE_STATIC);
if (unlikely(rc != SQLITE_OK))
goto bind_fail;
}
else
rc = sqlite3_bind_null(res, 5);
if (unlikely(rc != SQLITE_OK))
goto bind_fail;
param++;
rc = sqlite3_bind_text(res, 6, family, -1, SQLITE_STATIC);