From 8fde31a4e6760e6ef5cee75c736898901015184f Mon Sep 17 00:00:00 2001 From: José Bollo Date: Wed, 25 Oct 2017 11:17:15 +0200 Subject: database: fix regression bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I01722b00fc47e9b09c15e5123b8b0ef1a089c62e Signed-off-by: José Bollo --- ll-database-binding/src/ll-database-binding.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ll-database-binding/src/ll-database-binding.c b/ll-database-binding/src/ll-database-binding.c index bd6a2a0..924bb89 100644 --- a/ll-database-binding/src/ll-database-binding.c +++ b/ll-database-binding/src/ll-database-binding.c @@ -176,6 +176,7 @@ static int get_key(struct afb_req req, DBT *key) memcpy(&data[lappid + 1], jkey, ljkey + 1); /* return the key */ + memset(key, 0, sizeof *key); key->data = data; key->size = (uint32_t)size; return 0; @@ -212,6 +213,7 @@ static void put(struct afb_req req, int replace) AFB_INFO("put: key=%s, value=%s", (char*)key.data, value); + memset(&data, 0, sizeof data); data.data = (void*)value; data.size = (uint32_t)strlen(value) + 1; /* includes the tailing null */ @@ -271,6 +273,7 @@ static void verb_read(struct afb_req req) AFB_INFO("read: key=%s", (char*)key.data); + memset(&data, 0, sizeof data); data.data = value; data.ulen = 4096; data.flags = DB_DBT_USERMEM; -- cgit 1.2.3-korg