summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Stop linking a copy of _json_c_strerror() (strerror_override.c) into the tests.HEADmasterEric Haszlakiewicz2023-03-286-21/+2
| | | | | | That hasn't been needed since since commit 6068d3f, which changed that code to check an env var instead ("_JSON_C_STRERROR_ENABLE"). Fixes issue #812, about dup symbols in static builds with clang.
* Merge pull request #810 from dijonkitchen/patch-1Eric Hawicz2023-03-101-1/+1
|\ | | | | docs: update to Internet Standard reference
| * docs: update to Internet Standard referenceJC (Jonathan Chen)2023-03-101-1/+1
|/
* Bump up the minimum cmake version to 3.9.Eric Haszlakiewicz2023-02-231-32/+18
| | | | | | | This gets us up to a version that supports features we're already using (i.e. add_compile_options), but stops short of a cmake that requires c++11, which some OSes still don't support. Closes issue #774
* Issue #570: note brief instructions for building on Android.Eric Haszlakiewicz2023-01-051-0/+24
|
* Merge pull request #804 from yrashk/cmp-0042Eric Hawicz2022-12-271-1/+8
|\ | | | | Problem: cmake 3.25.1 warns about CMP0042 not being set
| * Problem: cmake 3.25.1 warns about CMP0042 not being setYurii Rashkovskii2022-12-231-1/+8
| | | | | | | | Solution: set it explictly to OLD behavior
* | Merge pull request #803 from yrashk/patch-2Eric Hawicz2022-12-271-1/+1
|\ \ | | | | | | Problem: confusing error message in snprintf_compat.h
| * | Problem: confusing error message in snprintf_compat.hYurii Rashkovskii2022-12-231-1/+1
| |/ | | | | Solution: fix it to reflect what's happening properly
* | Merge pull request #802 from yrashk/patch-1Eric Hawicz2022-12-271-2/+5
|\ \ | |/ |/| Problem: modern CMake warns about version 2.8
| * Problem: modern CMake warns about version 2.8Yurii Rashkovskii2022-12-231-2/+5
|/ | | | | | | | | The warning is as follows: ``` Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. ``` Solution: set it at 2.8.12
* Merge pull request #796 from fedefrancescon/test-add-int-getEric Hawicz2022-11-165-0/+73
|\ | | | | Added Test for get int functions
| * Fixed `test_int_get` expected outputFederico Francescon2022-11-161-1/+2
| |
| * Added basic tests for `json_object_get_int`, `json_object_get_int64`, ↵Federico Francescon2022-11-165-0/+72
|/ | | | `json_object_get_uint64`
* Update expected output for test_parse, missed in the previous commit.Eric Haszlakiewicz2022-10-301-1/+14
|
* Explicitly check for integer overflow/underflow when parsing integers with ↵Eric Haszlakiewicz2022-10-303-0/+46
| | | | JSON_TOKENER_STRICT.
* Apply same EINVAL handling to json_parse_uint64() as was done for ↵Eric Haszlakiewicz2022-10-302-2/+16
| | | | json_parse_int64(). Document that overflow/underflow for these functions is not an error, but sets errno=ERANGE.
* Issue #792 - set errno=EINVAL if parsing the string in json_parse_int64 ↵Eric Haszlakiewicz2022-10-261-1/+6
| | | | fails, to match the docs for json_object_get_int.
* Merge pull request #790 from Sarcares/patch-1Eric Hawicz2022-09-131-1/+1
|\ | | | | Small update to README file
| * Small update to README fileLuca Mannella2022-09-121-1/+1
|/ | | it could be necessary to execute make install
* Merge pull request #784 from rouault/get_time_seed_coverity_scan_silenceEric Hawicz2022-08-161-0/+1
|\ | | | | get_time_seed(): silence warning emitted by Coverity Scan static analyzer
| * get_time_seed(): silence warning emitted by Coverity Scan static analyzerEven Rouault2022-08-161-0/+1
|/ | | | | | | | It warns about the return of time() being truncated to 32 bit, which is not an issue here. (this warning was emitted because of the https://github.com/OSGeo/gdal project embedding a copy of libjson-c and running Coverity Scan analysis)
* Merge pull request #783 from kraj/masterEric Hawicz2022-08-1410-17/+23
|\ | | | | Fix build with clang-15+
| * json_pointer.c: Move idx_val declaration to top of functionKhem Raj2022-08-141-1/+2
| | | | | | | | | | | | | | | | | | This helps compiling with MS compiler, error seems to be due to defining a variable within the body of the function its allowed in c99 but not in c89. This should fix build with MSVC 16.0.40219.1 compiler from Visual Studio 14 2015 Signed-off-by: Khem Raj <raj.khem@gmail.com>
| * json_inttypes.h: Define ssize_t on windows platformsKhem Raj2022-08-131-0/+5
| | | | | | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
| * Fix build with clang-15+Khem Raj2022-08-138-16/+16
|/ | | | | | | | | | | Fixes json_util.c:63:35: error: a function declaration without a prototype is deprecated in all versions of C [-We rror,-Wstrict-prototypes] const char *json_util_get_last_err() ^ void Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Merge pull request #782 from DimitriPapadopoulos/codespellEric Hawicz2022-08-133-7/+7
|\ | | | | Fix typos found by codespell
| * Fix typos found by codespellDimitri Papadopoulos2022-08-133-7/+7
|/ | | | Do not fix typos from past commits found in release notes.
* Apply some of the fixes from PR #740, although by using size_t instead of ↵Eric Haszlakiewicz2022-07-314-28/+33
| | | | castings.
* Merge pull request #757 from c3h2-ctf/bigEric Hawicz2022-07-312-4/+23
|\ | | | | json_object_from_fd_ex: fail if file is too large
| * json_object_from_fd_ex: fail if file is too largeTobias Stoeckmann2022-03-203-5/+24
| | | | | | | | | | | | | | | | If the input file is too large to fit into a printbuf then return an error value instead of silently truncating the parsed content. This introduces errno handling into printbuf to distinguish between an input file being too large and running out of memory.
* | Issue #705: disable locale handling when building for a uClibc system ↵Eric Haszlakiewicz2022-07-303-2/+14
| | | | | | | | because its duplocale() function (intentionally) crashes.
* | When serializing with JSON_C_TO_STRING_PRETTY set, keep the opening and ↵Eric Haszlakiewicz2022-07-309-20/+42
| | | | | | | | closing curly or square braces on same line for empty objects or arrays. Issue #778.
* | Update Travis links to point at travis-ci.com instead of travis-ci.orgEric Haszlakiewicz2022-07-261-1/+1
| |
* | Entirely drop mode bits from open(O_RDONLY) to avoid warnings on certain ↵Eric Haszlakiewicz2022-07-261-5/+5
| | | | | | | | platforms. Fixes issue #779.
* | Trim a few travis builds, update others to more recent toolchains.Eric Haszlakiewicz2022-07-241-31/+25
| |
* | Fix the expected output for test_set_serializer.Eric Haszlakiewicz2022-07-241-1/+1
| |
* | Add test to check for the memory leak mentioned in issue #781Eric Haszlakiewicz2022-07-241-0/+8
| |
* | Merge pull request #781 from dddaniel/masterEric Hawicz2022-07-241-3/+10
|\ \ | | | | | | Fix memory leak with emtpy strings in json_object_set_string
| * | Fix memory leak with emtpy strings in json_object_set_stringDaniel Danzberger2022-07-241-3/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a json string object is updated with a bigger string, a new malloc'ed buffer is used to store the new string and it's size is made negative to indicate that an external buffer is in use. When that same json string object get's updated again with an empty stirng (size = 0), the new external malloc'ed buffer is still used. But the fact that the new size value is not negative removes the indicator that the externally malloc'ed buffer is used. This becomes a problem when the object get's updated again with any other string, because a new buffer will be malloced and linked to the object while to old one won't be free'd. This causes a memory leak when updating a json string with json_object_set_stirng() which has previously been updated with an empty string. Example: -- obj = json_object_new_string("data"); json_object_set_string(obj, "more data"); json_object_set_string(obj, ""); json_object_set_string(obj, "other data"); /* leaks */ -- This commit fixes the issue by free'ing the external buffer when an empty string is set and use the internal one again. Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
* | Fix issue #775 - use a loop instead of list(TRANSFORM ...) to support cmake ↵Eric Haszlakiewicz2022-06-271-1/+11
| | | | | | | | < 3.12.
* | Merge pull request #776 from stoeckmann/typoEric Hawicz2022-06-211-1/+1
|\ \ | | | | | | Fix typo
| * | Fix typoTobias Stoeckmann2022-06-211-1/+1
|/ /
* | Fix #771/#768 by marking usage() as "noreturn" instead of using "FALLTHRU" ↵Eric Haszlakiewicz2022-06-131-2/+15
| | | | | | | | in the case statement where it'd called.
* | Merge pull request #769 from An7ar35/issue-768Eric Hawicz2022-06-031-1/+1
|\ \ | | | | | | Issue #768
| * | missing 'FALLTHRU' added to sort out error messages when using ↵An7ar352022-06-011-1/+1
|/ / | | | | | | "-Werror=implicit-fallthrough" flag
* | Unset NDEBUG so assert() is enabled in all tests. One more fix there when ↵Eric Haszlakiewicz2022-05-3022-0/+67
| | | | | | | | building with -DCMAKE_BUILD_TYPE=release.
* | Specify dependent libraries, including -lbsd, in a more consistent way so ↵Eric Haszlakiewicz2022-05-301-2/+15
| | | | | | | | | | | | | | linking against a static json-c works better. Related issue #766 Use target_link_libraries, plus fill in Libs.private in json-c.pc so pkg-config --static --libs works appropriately. Also, only link against libbsd when arc4random is actually found there.
* | Include the tests and apps directories at the _end_, since order in theEric Haszlakiewicz2022-05-307-172/+172
| | | | | | | | | | cmake rules matters, and fix compile warnings now that we're building those sources with all the regular flags.
* | Add --disable-static and --disable-dynamic options to the cmake-configure ↵Eric Haszlakiewicz2022-05-301-0/+6
| | | | | | | | script.