diff options
author | Michael Clark <michael@metaparadigm.com> | 2009-02-25 01:51:40 +0000 |
---|---|---|
committer | Michael Clark <michael@metaparadigm.com> | 2009-02-25 01:51:40 +0000 |
commit | 22dee7cb59da4a96fe2ee0e33b4f394645698359 (patch) | |
tree | a45c63ad5b14317396b5eb60dea39c442124aeb9 /json_object.c | |
parent | e8de07880652465a3894124258796846832f0fff (diff) |
* Null pointer dereference fix. Fix json_object_get_boolean strlen test
to not return TRUE for zero length string. Remove redundant includes.
Erik Hovland, erik at hovland dot org
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@31 327403b1-1117-474d-bef2-5cb71233fd97
Diffstat (limited to 'json_object.c')
-rw-r--r-- | json_object.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/json_object.c b/json_object.c index a746859..44b6cd6 100644 --- a/json_object.c +++ b/json_object.c @@ -22,7 +22,6 @@ #include "arraylist.h" #include "json_object.h" #include "json_object_private.h" -#include "json_tokener.h" #if !HAVE_STRNDUP char* strndup(const char* str, size_t n); @@ -306,7 +305,7 @@ boolean json_object_get_boolean(struct json_object *this) case json_type_double: return (this->o.c_double != 0); case json_type_string: - if(strlen(this->o.c_string)) return TRUE; + return (strlen(this->o.c_string) != 0); default: return TRUE; } |