Imported Upstream version 0.12 99/50199/1 upstream/0.12
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 27 Oct 2015 01:23:00 +0000 (10:23 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 27 Oct 2015 01:38:10 +0000 (10:38 +0900)
Change-Id: If1adf769b75f62becce10d891d0974b9989e6979
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
.gitignore [new file with mode: 0644]
json_object.h
json_tokener.c

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..15000ba
--- /dev/null
@@ -0,0 +1,55 @@
+*~
+*.swp
+/INSTALL
+.deps/
+.libs/
+/aclocal.m4
+/autom4te.cache
+/config.guess
+/json_config.h
+/compile
+/config.h
+/config.log
+/config.status
+/config.sub
+/configure
+/depcomp
+/doc
+/install-sh
+/json.pc
+/json-c.pc
+/json-c-uninstalled.pc
+/libtool
+/ltmain.sh
+/Makefile
+/Makefile.in
+/missing
+/stamp-h1
+/stamp-h2
+/test-driver
+/tests/Makefile
+/tests/Makefile.in
+/tests/test1
+/tests/test1Formatted
+/tests/test2
+/tests/test2Formatted
+/tests/test4
+/tests/testReplaceExisting
+/tests/testSubDir
+/tests/test_parse_int64
+/tests/test_parse
+/tests/test_cast
+/tests/test_charcase
+/tests/test_locale
+/tests/test_null
+/tests/test_printbuf
+/tests/test_set_serializer
+/tests/*.vg.out
+/tests/*.log
+/tests/*.trs
+/Debug
+/Release
+*.lo
+*.o
+/libjson-c.la
+/libjson.la
index e6c6a4f..200ac40 100644 (file)
@@ -339,8 +339,8 @@ extern void json_object_object_del(struct json_object* obj, const char *key);
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
 
 # define json_object_object_foreach(obj,key,val) \
-       char *key = NULL; \
-       struct json_object *val = NULL; \
+       char *key; \
+       struct json_object *val __attribute__((__unused__)); \
        for(struct lh_entry *entry ## key = json_object_get_object(obj)->head, *entry_next ## key = NULL; \
                ({ if(entry ## key) { \
                        key = (char*)entry ## key->k; \
index 9a76293..19de8ef 100644 (file)
@@ -352,10 +352,12 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
 
     case json_tokener_state_inf: /* aka starts with 'i' */
       {
+       int size;
        int size_inf;
        int is_negative = 0;
 
        printbuf_memappend_fast(tok->pb, &c, 1);
+       size = json_min(tok->st_pos+1, json_null_str_len);
        size_inf = json_min(tok->st_pos+1, json_inf_str_len);
        char *infbuf = tok->pb->buf;
        if (*infbuf == '-')