aboutsummaryrefslogtreecommitdiff
path: root/src/value.c
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2011-06-17 21:42:11 +0300
committerPetri Lehtinen <petri@digip.org>2011-06-17 21:42:19 +0300
commitc0193bfb7fd4bed31fc68e8f991281aba2973dd0 (patch)
tree630e745c5a098003f933cc9b29636fc931ad4559 /src/value.c
parent6e1f4bb560d18f290b3eba05f124389202e770ea (diff)
downloadjansson-c0193bfb7fd4bed31fc68e8f991281aba2973dd0.zip
jansson-c0193bfb7fd4bed31fc68e8f991281aba2973dd0.tar.gz
jansson-c0193bfb7fd4bed31fc68e8f991281aba2973dd0.tar.bz2
Check that target is string and value is not NULL in json_string_set()
Diffstat (limited to 'src/value.c')
-rw-r--r--src/value.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/value.c b/src/value.c
index 47ebb2c..d0517d5 100644
--- a/src/value.c
+++ b/src/value.c
@@ -703,6 +703,9 @@ int json_string_set_nocheck(json_t *json, const char *value)
char *dup;
json_string_t *string;
+ if(!json_is_string(json) || !value)
+ return -1;
+
dup = jsonp_strdup(value);
if(!dup)
return -1;