projects
/
jansson.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8de850b
)
Check json_object_set_new arguments
author
Petri Lehtinen
<petri@digip.org>
Sat, 10 Oct 2009 19:53:36 +0000
(22:53 +0300)
committer
Petri Lehtinen
<petri@digip.org>
Sat, 10 Oct 2009 19:53:36 +0000
(22:53 +0300)
A segfault was caused by NULL key.
src/value.c
patch
|
blob
|
history
diff --git
a/src/value.c
b/src/value.c
index
bf5fd54
..
d8e9e9a
100644
(file)
--- a/
src/value.c
+++ b/
src/value.c
@@
-148,7
+148,7
@@
int json_object_set_nocheck(json_t *json, const char *key, json_t *value)
int json_object_set_new(json_t *json, const char *key, json_t *value)
{
- if(!utf8_check_string(key, -1))
+ if(!
key || !
utf8_check_string(key, -1))
{
json_decref(value);
return -1;