]>
Commit | Line | Data |
---|---|---|
8ce53f9d | 1 | |
0631c37c EH |
2 | Next version, 0.14 |
3 | ================== | |
4 | ||
5 | Nothing yet. | |
6 | ||
7 | ||
b34d26ff EH |
8 | 0.13 (up to commit 5dae561, 2017/11/29) |
9 | ================================= | |
10 | ||
11 | This release, being three and a half years after the 0.12 branch (f84d9c), | |
12 | has quite a number of changes included. The following is a sampling of | |
13 | the most significant ones. | |
14 | ||
15 | Since the 0.12 release, 250 issues and pull requests have been closed. | |
16 | See issues_closed_for_0.13.md for a complete list. | |
17 | ||
18 | ||
19 | Deprecated and removed features: | |
20 | -------------------------------- | |
21 | * All internal use of bits.h has been eliminated. The file will be removed. | |
22 | Do not use: hexdigit(), error_ptr(), error_descrition() and it_error() | |
23 | * lh_abort() is deprecated. It will be removed. | |
24 | ||
25 | Behavior changes: | |
26 | ----------------- | |
27 | * Tighten the number parsing algorithm to raise errors instead of truncating | |
28 | the results. For example 12.3.4 or 2015-01-15, which now return null. | |
29 | See commit 99d8fc | |
30 | ||
31 | * Use size_t for array length and size. Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible | |
32 | See commits 45c56b, 92e9a5 and others. | |
33 | ||
34 | * Check for failue when allocating memory, returning NULL and errno=ENOMEM. | |
35 | See commit 2149a04. | |
36 | ||
37 | * Change json_object_object_add() return type from void to int, and will return -1 on failures, instead of exiting. (Note: this is not an ABI change) | |
38 | ||
39 | New features: | |
40 | ------------- | |
41 | * We're aiming to follow RFC 7159 now. | |
42 | ||
43 | * Add a couple of additional option to json_object_to_json_string_ext: | |
44 | JSON_C_TO_STRING_PRETTY_TAB | |
45 | JSON_C_TO_STRING_NOSLASHESCAPE | |
46 | ||
47 | * Add a json_object_object_add_ex() function to allow for performance | |
48 | improvements when certain constraints are known to be true. | |
49 | ||
50 | * Make serialization format of doubles configurable, in two different ways: | |
51 | Call json_object_set_serializer with json_object_double_to_json_string and a custom | |
52 | format on each double object, or | |
53 | Call json_c_set_serialization_double_format() to set a global or thread-wide format. | |
54 | ||
55 | * Add utility function for comparing json_objects - json_object_equal() | |
56 | ||
57 | * Add a way to copy entire object trees: json_object_deep_copy() | |
58 | * Add json_object_set_<type> function to modify the value of existing json_object's | |
59 | without the need to recreate them. Also add a json_object_int_inc function to | |
60 | adjust an int's value. | |
61 | * Add support for JSON pointer, RFC 6901. See json_pointer.h | |
62 | * Add a json_util_get_last_err() function to retrieve the string describing the | |
63 | cause of errors, instead of printing to stderr. | |
64 | * Add perllike hash function for strings, and json_global_set_string_hash() 8f8d03d | |
65 | * Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects. | |
66 | ||
67 | Notable bug fixes and other improvements: | |
68 | ----------------------------------------- | |
69 | * Make reference increment and decrement atomic to allow passing json objects between threads. | |
70 | * Fix json_object_object_foreach to avoid uninitialized variable warnings. | |
71 | * Improve performance by removing unneeded data items from hashtable code and reducing duplicate hash computation. | |
72 | * Improve performance by storing small strings inside json_object | |
73 | * Improve performance of json_object_to_json_string by removing variadic printf. commit 9ff0f49 | |
74 | * Issue #371: fix parsing of "-Infinity", and avoid needlessly copying the input when doing so. | |
75 | * Fix stack buffer overflow in json_object_double_to_json_string_format() - commit 2c2deb87 | |
76 | * Fix various potential null ptr deref and int32 overflows | |
77 | * Issue #332: fix a long-standing bug in array_list_put_idx() where it would attempt to free previously free'd entries due to not checking the current array length. | |
78 | * Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments. | |
79 | * Issue #275: fix out of bounds read when handling unicode surrogate pairs. | |
80 | * Ensure doubles that happen to be a whole number are emitted with ".0" - commit ca7a19 | |
81 | * PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated. | |
82 | * Fix double to int cast overflow in json_object_get_int64. | |
83 | * Clamp double to int32 when narrowing in json_object_get_int. | |
84 | * Use strtoll() to parse ints - instead of sscanf | |
85 | * Miscellaneous smaller changes, including removing unused variables, fixing warning | |
86 | about uninitialized variables adding const qualifiers, reformatting code, etc... | |
87 | ||
88 | Build changes: | |
89 | -------------- | |
90 | * Add Appveyor and Travis build support | |
91 | * Switch to using CMake when building on Windows with Visual Studio. | |
92 | A dynamic .dll is generated instead of a .lib | |
93 | config.h is now generated, config.h.win32 should no longer be manually copied | |
94 | * Add support for MacOS through CMake too. | |
95 | * Enable silent build by default | |
96 | * Link against libm when needed | |
97 | * Add support for building with AddressSanitizer | |
98 | * Add support for building with Clang | |
99 | * Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified. | |
100 | ||
101 | List of new functions added: | |
102 | ---------------------------- | |
103 | ### json_object.h | |
104 | * array_list_bsearch() | |
105 | * array_list_del_idx() | |
106 | * json_object_to_json_string_length() | |
107 | * json_object_get_userdata() | |
108 | * json_object_set_userdata() | |
109 | * json_object_object_add_ex() | |
110 | * json_object_array_bsearch() | |
111 | * json_object_array_del_idx() | |
112 | * json_object_set_boolean() | |
113 | * json_object_set_int() | |
114 | * json_object_int_inc() | |
115 | * json_object_set_int64() | |
116 | * json_c_set_serialization_double_format() | |
117 | * json_object_double_to_json_string() | |
118 | * json_object_set_double() | |
119 | * json_object_set_string() | |
120 | * json_object_set_string_len() | |
121 | * json_object_equal() | |
122 | * json_object_deep_copy() | |
123 | ||
124 | ### json_pointer.h | |
125 | * json_pointer_get() | |
126 | * json_pointer_getf() | |
127 | * json_pointer_set() | |
128 | * json_pointer_setf() | |
129 | ||
130 | ### json_util.h | |
131 | * json_object_from_fd() | |
132 | * json_object_to_fd() | |
133 | * json_util_get_last_err() | |
134 | ||
135 | ### json_visit.h | |
136 | * json_c_visit() | |
137 | ||
138 | ### linkhash.h | |
139 | * json_global_set_string_hash() | |
140 | * lh_table_resize() | |
141 | ||
142 | ### printbuf.h | |
143 | * printbuf_strappend() | |
515ba0df | 144 | |
515ba0df | 145 | |
a42caac8 | 146 | 0.12.1 |
b34d26ff | 147 | ====== |
a42caac8 EH |
148 | |
149 | * Minimal changes to address compile issues. | |
150 | ||
f84d9c55 | 151 | 0.12 |
b34d26ff | 152 | ==== |
f84d9c55 EH |
153 | |
154 | * Address security issues: | |
155 | * CVE-2013-6371: hash collision denial of service | |
156 | * CVE-2013-6370: buffer overflow if size_t is larger than int | |
157 | ||
158 | * Avoid potential overflow in json_object_get_double | |
159 | ||
160 | * Eliminate the mc_abort() function and MC_ABORT macro. | |
161 | ||
162 | * Make the json_tokener_errors array local. It has been deprecated for | |
163 | a while, and json_tokener_error_desc() should be used instead. | |
164 | ||
165 | * change the floating point output format to %.17g so values with | |
166 | more than 6 digits show up in the output. | |
167 | ||
168 | * Remove the old libjson.so name compatibility support. The library is | |
169 | only created as libjson-c.so now and headers are only installed | |
170 | into the ${prefix}/json-c directory. | |
171 | ||
172 | * When supported by the linker, add the -Bsymbolic-functions flag. | |
173 | ||
174 | * Various changes to fix the build on MSVC. | |
175 | ||
176 | * Make strict mode more strict: | |
177 | * number must not start with 0 | |
178 | * no single-quote strings | |
179 | * no comments | |
180 | * trailing char not allowed | |
181 | * only allow lowercase literals | |
4207147c | 182 | |
51993c28 EH |
183 | * Added a json_object_new_double_s() convenience function to allow |
184 | an exact string representation of a double to be specified when | |
185 | creating the object and use it in json_tokener_parse_ex() so | |
186 | a re-serialized object more exactly matches the input. | |
4207147c | 187 | |
f84d9c55 EH |
188 | * Add support NaN and Infinity |
189 | ||
190 | ||
eee744cd | 191 | 0.11 |
b34d26ff | 192 | ==== |
8ce53f9d EH |
193 | |
194 | * IMPORTANT: the name of the library has changed to libjson-c.so and | |
195 | the header files are now in include/json-c. | |
196 | The pkgconfig name has also changed from json to json-c. | |
197 | You should change your build to use appropriate -I and -l options. | |
198 | A compatibility shim is in place so builds using the old name will | |
199 | continue to work, but that will be removed in the next release. | |
197cb1d1 RC |
200 | * Maximum recursion depth is now a runtime option. |
201 | json_tokener_new() is provided for compatibility. | |
202 | json_tokener_new_ex(depth) | |
eee744cd EH |
203 | * Include json_object_iterator.h in the installed headers. |
204 | * Add support for building on Android. | |
205 | * Rewrite json_object_object_add to replace just the value if the key already exists so keys remain valid. | |
206 | * Make it safe to delete keys while iterating with the json_object_object_foreach macro. | |
207 | * Add a json_set_serializer() function to allow the string output of a json_object to be customized. | |
208 | * Make float parsing locale independent. | |
209 | * Add a json_tokener_set_flags() function and a JSON_TOKENER_STRICT flag. | |
210 | * Enable -Werror when building. | |
211 | * speed improvements to parsing 64-bit integers on systems with working sscanf | |
212 | * Add a json_object_object_length function. | |
213 | * Fix a bug (buffer overrun) when expanding arrays to more than 64 entries. | |
8ce53f9d | 214 | |
f5dd43a9 | 215 | 0.10 |
b34d26ff | 216 | ==== |
1abaaee6 EH |
217 | |
218 | * Add a json_object_to_json_string_ext() function to allow output to be | |
219 | formatted in a more human readable form. | |
220 | * Add json_object_object_get_ex(), a NULL-safe get object method, to be able | |
221 | to distinguish between a key not present and the value being NULL. | |
222 | * Add an alternative iterator implementation, see json_object_iterator.h | |
223 | * Make json_object_iter public to enable external use of the | |
224 | json_object_object_foreachC macro. | |
225 | * Add a printbuf_memset() function to provide an effecient way to set and | |
226 | append things like whitespace indentation. | |
227 | * Adjust json_object_is_type and json_object_get_type so they return | |
228 | json_type_null for NULL objects and handle NULL passed to | |
229 | json_objct_object_get(). | |
230 | * Rename boolean type to json_bool. | |
231 | * Fix various compile issues for Visual Studio and MinGW. | |
232 | * Allow json_tokener_parse_ex() to be re-used to parse multiple object. | |
233 | Also, fix some parsing issues with capitalized hexadecimal numbers and | |
234 | number in E notation. | |
235 | * Add json_tokener_get_error() and json_tokener_error_desc() to better | |
236 | encapsulate the process of retrieving errors while parsing. | |
237 | * Various improvements to the documentation of many functions. | |
238 | * Add new json_object_array_sort() function. | |
20707f4e EH |
239 | * Fix a bug in json_object_get_int(), which would incorrectly return 0 |
240 | when called on a string type object. | |
241 | Eric Haszlakiewicz | |
242 | * Add a json_type_to_name() function. | |
243 | Eric Haszlakiewicz | |
244 | * Add a json_tokener_parse_verbose() function. | |
245 | Jehiah Czebotar | |
246 | * Improve support for null bytes within JSON strings. | |
247 | Jehiah Czebotar | |
bd0a5676 MC |
248 | * Fix file descriptor leak if memory allocation fails in json_util |
249 | Zachary Blair, zack_blair at hotmail dot com | |
c4dceae1 MC |
250 | * Add int64 support. Two new functions json_object_net_int64 and |
251 | json_object_get_int64. Binary compatibility preserved. | |
252 | Eric Haszlakiewicz, EHASZLA at transunion com | |
253 | Rui Miguel Silva Seabra, rms at 1407 dot org | |
f5dd43a9 MC |
254 | * Fix subtle bug in linkhash where lookup could hang after all slots |
255 | were filled then successively freed. | |
256 | Spotted by Jean-Marc Naud, j dash m at newtraxtech dot com | |
257 | * Make json_object_from_file take const char *filename | |
258 | Spotted by Vikram Raj V, vsagar at attinteractive dot com | |
126ad95f BM |
259 | * Add handling of surrogate pairs (json_tokener.c, test4.c, Makefile.am) |
260 | Brent Miller, bdmiller at yahoo dash inc dot com | |
f8663fc1 BM |
261 | * Correction to comment describing printbuf_memappend in printbuf.h |
262 | Brent Miller, bdmiller at yahoo dash inc dot com | |
263 | ||
68cafad0 | 264 | 0.9 |
b34d26ff | 265 | === |
09abeffd MC |
266 | * Add README.html README-WIN32.html config.h.win32 to Makefile.am |
267 | Michael Clark, <michael@metaparadigm.com> | |
b22565d1 CW |
268 | * Add const qualifier to the json_tokener_parse functions |
269 | Eric Haszlakiewicz, EHASZLA at transunion dot com | |
7fb9b03f | 270 | * Rename min and max so we can never clash with C or C++ std library |
c80ba8dd | 271 | Ian Atha, thatha at yahoo dash inc dot com |
543bb143 CW |
272 | * Fix any noticeable spelling or grammar errors. |
273 | * Make sure every va_start has a va_end. | |
274 | * Check all pointers for validity. | |
275 | Erik Hovland, erik at hovland dot org | |
24ea8c04 MC |
276 | * Fix json_object_get_boolean to return false for empty string |
277 | Spotted by Vitaly Kruglikov, Vitaly dot Kruglikov at palm dot com | |
95f55a76 MC |
278 | * optimizations to json_tokener_parse_ex(), printbuf_memappend() |
279 | Brent Miller, bdmiller at yahoo dash inc dot com | |
c5cbf821 | 280 | * Disable REFCOUNT_DEBUG by default in json_object.c |
266a3fd3 | 281 | * Don't use this as a variable, so we can compile with a C++ compiler |
aaec1ef3 MC |
282 | * Add casts from void* to type of assignment when using malloc |
283 | * Add #ifdef __cplusplus guards to all of the headers | |
284 | * Add typedefs for json_object, json_tokener, array_list, printbuf, lh_table | |
266a3fd3 | 285 | Michael Clark, <michael@metaparadigm.com> |
22dee7cb MC |
286 | * Null pointer dereference fix. Fix json_object_get_boolean strlen test |
287 | to not return TRUE for zero length string. Remove redundant includes. | |
288 | Erik Hovland, erik at hovland dot org | |
e8de0788 MC |
289 | * Fixed warning reported by adding -Wstrict-prototypes |
290 | -Wold-style-definition to the compilatin flags. | |
291 | Dotan Barak, dotanba at gmail dot com | |
68cafad0 MC |
292 | * Add const correctness to public interfaces |
293 | Gerard Krol, g dot c dot krol at student dot tudelft dot nl | |
294 | ||
dfaf6704 | 295 | 0.8 |
b34d26ff | 296 | === |
8cdac64c MC |
297 | * Add va_end for every va_start |
298 | Dotan Barak, dotanba at gmail dot com | |
dfaf6704 MC |
299 | * Add macros to enable compiling out debug code |
300 | Geoffrey Young, geoff at modperlcookbook dot org | |
c8f4a6e7 MC |
301 | * Fix bug with use of capital E in numbers with exponents |
302 | Mateusz Loskot, mateusz at loskot dot net | |
303 | * Add stddef.h include | |
14862b1e MC |
304 | * Patch allows for json-c compile with -Werror and not fail due to |
305 | -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations | |
306 | Geoffrey Young, geoff at modperlcookbook dot org | |
dfaf6704 | 307 | |
a850f8e2 | 308 | 0.7 |
b34d26ff | 309 | === |
a850f8e2 MC |
310 | * Add escaping of backslash to json output |
311 | * Add escaping of foward slash on tokenizing and output | |
312 | * Changes to internal tokenizer from using recursion to | |
313 | using a depth state structure to allow incremental parsing | |
314 | ||
837240f7 | 315 | 0.6 |
b34d26ff | 316 | === |
837240f7 MC |
317 | * Fix bug in escaping of control characters |
318 |