Code Review
/
apps
/
agl-service-data-persistence.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(from parent 1:
b18e88a
)
database: fix regression bug
author
José Bollo
<jose.bollo@iot.bzh>
Wed, 25 Oct 2017 09:17:15 +0000
(11:17 +0200)
committer
José Bollo
<jose.bollo@iot.bzh>
Wed, 25 Oct 2017 09:17:15 +0000
(11:17 +0200)
Change-Id: I01722b00fc47e9b09c15e5123b8b0ef1a089c62e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
ll-database-binding/src/ll-database-binding.c
patch
|
blob
|
history
diff --git
a/ll-database-binding/src/ll-database-binding.c
b/ll-database-binding/src/ll-database-binding.c
index
bd6a2a0
..
924bb89
100644
(file)
--- 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;