summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInkyun Kil <inkyun.kil@samsung.com>2019-11-21 00:29:33 (GMT)
committerInkyun Kil <inkyun.kil@samsung.com>2019-11-21 00:33:49 (GMT)
commitb14868db072664e9a8ef6569ac09e146559f7864 (patch)
treea22705214f3a7599800aeb03fbf16145762d3dd7
parent4fe0c3a59e97805d0f885065d20f1152ca3ece49 (diff)
downloadbundle-b14868db072664e9a8ef6569ac09e146559f7864.zip
bundle-b14868db072664e9a8ef6569ac09e146559f7864.tar.gz
bundle-b14868db072664e9a8ef6569ac09e146559f7864.tar.bz2
Fix static analysis issuerefs/changes/49/218249/2
Change-Id: Id09fa513a35be23af3049f9c499077939f54ab08
-rw-r--r--src/keyval_array.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/keyval_array.c b/src/keyval_array.c
index a9087c5..6dddc35 100644
--- a/src/keyval_array.c
+++ b/src/keyval_array.c
@@ -207,6 +207,9 @@ int keyval_array_set_element(keyval_array_t *kva, int idx, void *val, size_t siz
keyval_t *kv = (keyval_t *)kva;
char *str;
+ if (size <= 0)
+ return BUNDLE_ERROR_INVALID_PARAMETER;
+
/* An element is already exist in the idx! */
if (kva->array_val[idx]) {
/* val==NULL means 'Free this element!' */