aboutsummaryrefslogtreecommitdiff
path: root/src/value.c
AgeCommit message (Collapse)AuthorFilesLines
2016-09-18Update copyrights for 2016Petri Lehtinen1-1/+1
2016-06-20Always preserve insertion order of object itemsPetri Lehtinen1-4/+1
2016-02-03[Optimized functions]Maxim Zhukov1-67/+74
Optimized json_equal, json_delete, json_copy, json_deep_copy Replaced if to switch Removed unnecessary check for NULL.
2014-04-08use __sun instead of sunKarl Lew1-1/+1
2014-04-06SmartOS build fixKarl Lew1-0/+2
2014-02-11Merge branch '2.6'Petri Lehtinen1-0/+16
2014-02-11CVE-2013-6401: Change hash function, randomize hashesPetri Lehtinen1-0/+16
Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing and testing.
2014-01-28Update copyrights for 2014Petri Lehtinen1-1/+1
2013-12-28Check for key == NULL in json_object_get and json_object_delnmlgc1-2/+2
2013-10-03paper bag bug: json_string_set* functions should set the length tooChip Salzenberg1-0/+1
2013-09-27Support \u0000 - add size_t string lengths to API, load and dump \u000, etc.Chip Salzenberg1-15/+87
Also: Steal strings during parsing for half the mallocs! Change all input-caused assertions to errors. No crashes please, we're programmers.
2013-07-23Update copyrights for 2013Petri Lehtinen1-1/+1
2013-07-08Make the argument of json_deep_copy() constPetri Lehtinen1-11/+19
Fixes #126.
2013-04-02Merge pull request #108 from Zillode/1edff47af38a2335f88300ee6dc437118f5a20ffPetri Lehtinen1-0/+2
Fixes redefined warnings ("_GNU_SOURCE")
2013-03-14Do not define _GNU_SOURCE is already definedLode Hoste1-0/+2
2012-12-04Really fix the off-by-one error in json_array_remove()Petri Lehtinen1-1/+1
It didn't affect only the last element but all of them. One item too much was always moved.
2012-12-04Fix an off-by-one error in json_array_remove()Petri Lehtinen1-1/+4
Uninitialized memory was read when the last item of a "full" array was removed.
2012-09-13Disallow NaN or Inf real valuesPetri Lehtinen1-2/+15
2012-09-13Fix json_real_set() to return -1 on errorPetri Lehtinen1-1/+1
2012-04-29Support building on WindowsPetri Lehtinen1-2/+2
Jansson now builds correctly with Visual C++ Express 2010.
2012-03-20Update copyright notices for 2012Petri Lehtinen1-1/+1
2012-01-24Add json_object_update_{existing,missing}Petri Lehtinen1-0/+32
Closes #37.
2012-01-24Implement json_object_foreach()Petri Lehtinen1-46/+22
Also change many places to use it internally to replace hand-crafted iteration. Closes #45, #46.
2012-01-24Make hashtable less genericPetri Lehtinen1-79/+7
This will make it possible to implement json_object_foreach(). It should also have some (positive) effect on speed.
2012-01-24Fix a potential memory leakPetri Lehtinen1-2/+2
2011-11-14Avoid problems with object's serial number growing too bigPetri Lehtinen1-0/+2
Transform serial key comparison from substraction to real comparison. Reset serial to zero in json_object_clear() to avoid it growing out of bounds when reusing objects. Closes GH-40. Closes GH-41.
2011-06-17Check that target is string and value is not NULL in json_string_set()Petri Lehtinen1-0/+3
2011-04-21Fix a leak when memory allocation fails in json_object_set() & friends2.0Petri Lehtinen1-0/+3
2011-03-30Fix invalid object key hashing in json_unpack() strict checking modePetri Lehtinen1-12/+23
The keys which are stored temporarily to a hashtable to make sure that all object keys are unpacked, were hashed with the object key hashing function. It is meant to compute hashes for object_key_t values, and it works incorrectly for plain strings. Fixed by introducing suitable functions for hashing and comparing strings for string-keyed hashtables.
2011-03-21Fix json_object_size() return valuePetri Lehtinen1-1/+1
Return 0 as documented if the argument is not a JSON object. Closes GH-18.
2011-02-17Add custom memory allocationPetri Lehtinen1-25/+26
Thanks to Basile Starynkevitch for the suggestion and initial patch. Thanks to Jonathan Landis and Deron Meranda for showing how this can be utilized for implementing secure memory operations.
2011-01-25Add validation features to json_unpack()Petri Lehtinen1-3/+4
* By default, json_unpack() now checks that all items of arrays and objects are unpacked. This is useful for validation. * Add format specifier '*' to suppress this check for individual arrays and objects. '*' must appear as the last format specifier before the closing ']' or '}'.
2011-01-22Update copyright notices for 2011Petri Lehtinen1-1/+1
2010-09-05Move max() to jansson_private.h, define only if not already definedPetri Lehtinen1-1/+0
On some platforms (Visual C++ for one) the standard library already defines max() as a macro.
2010-09-05Don't use designated struct initializersPetri Lehtinen1-12/+3
It's a C99 feature and not available on all compilers (Visual C++, for example).
2010-09-05Replace all occurences of inline with JSON_INLINEPetri Lehtinen1-3/+1
This makes it easier to compile without the configure script (e.g. on Windows).
2010-08-14Merge branch '1.3'Petri Lehtinen1-3/+6
Conflicts: doc/apiref.rst src/jansson_private.h
2010-08-13Change the underlying type of JSON integer from long to json_int_tPetri Lehtinen1-3/+3
json_int_t is typedef'd to long long if it's supported, or long otherwise. There's also some supporting things, like the JSON_INTEGER_FORMAT macro that expands to the printf() conversion specifier that corresponds to json_int_t's actual type. This is a backwards incompatible change.
2010-08-12Make object_key_t portablePetri Lehtinen1-3/+6
A flexible array member is unportable. Use a table of length 1 instead. This needs some adjustment to the memory allocatio, too.
2010-08-10Change JSON integer's underlying type from int to longPetri Lehtinen1-3/+3
This is a backwards incompatible change.
2010-06-15Unify unsigned integer usage in the APIPetri Lehtinen1-26/+26
Replace all occurences of unsigned int and unsigned long with size_t. This is a backwards incompatible change, as the signature of many API functions changes.
2010-03-28Merge branch '1.2'Petri Lehtinen1-0/+3
Conflicts: configure.ac
2010-03-28Support compilers that don't have the "inline" keywordPetri Lehtinen1-0/+3
Use AC_C_INLINE autoconf macro, include config.h where needed, and add a define of JSON_INLINE to jansson.h that has the correct "inline" keyword.
2010-03-23Merge branch '1.2'Petri Lehtinen1-3/+3
2010-03-23Fix reference counting on true, false and nullPetri Lehtinen1-3/+3
Initialize their reference counts to (unsigned int)-1 to disable reference counting on them. It already was meant to work like this, but the reference counts were just initialized to 1 instead of -1. Thanks to Andrew Thompson for reporting this issue.
2010-02-11Implement JSON_PRESERVE_ORDER encoding flagPetri Lehtinen1-10/+35
With this encoding flag, the object key-value pairs in output are in the same order in which they were first inserted into the object. To make this possible, a key of an object is now a serial number plus a string. An object keeps an increasing counter which is used to assign serial number to the keys. Hashing, comparison and public API functions were changed to act only on the string part, i.e. the serial number is ignored everywhere else but in the encoder, where it's used to order object keys if JSON_PRESERVE_ORDER flag is used.
2010-02-04Merge branch '1.2'Petri Lehtinen1-1/+1
Conflicts: LICENSE
2010-02-02Add year 2010 to copyright noticesPetri Lehtinen1-1/+1
2010-02-01Add functions json_object_iter_{at,set,set_new}Petri Lehtinen1-0/+24
2010-01-10Fix memory leaks in json_*_deep_copy()Petri Lehtinen1-2/+2