]> granicus.if.org Git - json-c/log
json-c
2 years agoPut the most recent image first in appveyor builds. newer-appveyor
Eric Haszlakiewicz [Mon, 29 Nov 2021 18:21:05 +0000 (18:21 +0000)]
Put the most recent image first in appveyor builds.

2 years agoSkip most "Release" builds. s/b_config/CONFIGURATION/ to fix artifact creation.
Eric Haszlakiewicz [Mon, 29 Nov 2021 18:18:48 +0000 (18:18 +0000)]
Skip most "Release" builds.  s/b_config/CONFIGURATION/ to fix artifact creation.

2 years agoThere doesn't seem to be a way to extend the appveyor build matrix for just one image...
Eric Haszlakiewicz [Sat, 27 Nov 2021 02:55:29 +0000 (02:55 +0000)]
There doesn't seem to be a way to extend the appveyor build matrix for just one image, so instead list a whole bunch of excluded builds.

2 years agoUse the newer appveyor images to build for VS2017 and VS2019. Trim the number of...
Eric Haszlakiewicz [Sat, 27 Nov 2021 02:29:26 +0000 (02:29 +0000)]
Use the newer appveyor images to build for VS2017 and VS2019.  Trim the number of builds we do.

2 years agoNote the need to also set CTEST_OUTPUT_ON_FAILURE to get test output
Eric Haszlakiewicz [Fri, 26 Nov 2021 22:49:06 +0000 (22:49 +0000)]
Note the need to also set CTEST_OUTPUT_ON_FAILURE to get test output

2 years agoMerge pull request #732 from DiracResearch/fix/static_include_dirs
Eric Hawicz [Fri, 12 Nov 2021 04:52:43 +0000 (23:52 -0500)]
Merge pull request #732 from DiracResearch/fix/static_include_dirs

Fix/static include dirs

2 years agoFix uninitialized value error for clang-8 msan
Robert Bielik [Thu, 11 Nov 2021 09:23:05 +0000 (10:23 +0100)]
Fix uninitialized value error for clang-8 msan

2 years agoFix for clang ub sanitizer
Robert Bielik [Thu, 11 Nov 2021 08:35:31 +0000 (09:35 +0100)]
Fix for clang ub sanitizer

2 years agoAdd target include dirs for static library as well
Robert Bielik [Wed, 10 Nov 2021 15:04:01 +0000 (16:04 +0100)]
Add target include dirs for static library as well

2 years agoMerge pull request #727 from jobol/propo2
Eric Hawicz [Fri, 22 Oct 2021 23:06:11 +0000 (19:06 -0400)]
Merge pull request #727 from jobol/propo2

Really use prefix JSON_C_OBJECT_ADD_

2 years agoReally use prefix JSON_C_OBJECT_ADD_*
José Bollo [Tue, 12 Oct 2021 12:42:12 +0000 (14:42 +0200)]
Really use prefix JSON_C_OBJECT_ADD_*

This change introduces JSON_C_OBJECT_ADD_CONSTANT_KEY
as a replacement of JSON_C_OBJECT_KEY_IS_CONSTANT.

The description of json_object_object_add_ex tells to
look at the flags JSON_C_OBJECT_ADD_* but it is not
for JSON_C_OBJECT_KEY_IS_CONSTANT.

From the point of vue of a developper using json-c,
the function json_object_object_add_ex is mainly used,
not the hash facility, it seems more natural to provide
a regular naming of prefix JSON_C_OBJECT_ADD_CONSTANT_KEY.

2 years agoMerge pull request #729 from DeX77/patch-1
Eric Hawicz [Sun, 17 Oct 2021 18:23:28 +0000 (14:23 -0400)]
Merge pull request #729 from DeX77/patch-1

* don't assume includedir

2 years ago* don't assume includedir
DeX77 [Fri, 15 Oct 2021 09:12:39 +0000 (11:12 +0200)]
* don't assume includedir

This change syncs the public header include install location with what gets written into pkgconfig file.

2 years agoMerge pull request #726 from leongross/fix/test-cmake3.1
Eric Hawicz [Sat, 9 Oct 2021 13:17:25 +0000 (09:17 -0400)]
Merge pull request #726 from leongross/fix/test-cmake3.1

fix cmake version for tests

2 years agofix cmake version for tests
Leon Gross [Wed, 6 Oct 2021 12:40:52 +0000 (14:40 +0200)]
fix cmake version for tests

2 years agoMerge pull request #722 from imaami/fix-json_tokener_new_ex-use-after-free
Eric Hawicz [Sun, 5 Sep 2021 03:16:13 +0000 (23:16 -0400)]
Merge pull request #722 from imaami/fix-json_tokener_new_ex-use-after-free

Fix use-after-free in json_tokener_new_ex()

2 years agoFix use-after-free in json_tokener_new_ex()
Juuso Alasuutari [Sat, 4 Sep 2021 17:14:30 +0000 (20:14 +0300)]
Fix use-after-free in json_tokener_new_ex()

The failure path taken in the event of printbuf_new() returning NULL
calls free() on tok->stack after already having freed tok. Swap the
order of the two calls to fix an obvious memory access violation.

Fixes: bcb6d7d3474b ("Handle allocation failure in json_tokener_new_ex")
Signed-off-by: Juuso Alasuutari <juuso.alasuutari@gmail.com>
2 years agoMerge pull request #718 from Pawday/master
Eric Hawicz [Sun, 1 Aug 2021 02:46:01 +0000 (22:46 -0400)]
Merge pull request #718 from Pawday/master

CMake create uninstall target if unix generator is used

2 years agoSetted cmake "uninstall" target to exist in unix like operating systems only
Pawday [Mon, 26 Jul 2021 15:52:29 +0000 (18:52 +0300)]
Setted cmake "uninstall" target to exist in unix like operating systems only

2 years agoAdd workaround for Visual Studio not knowing about "inline".
Eric Haszlakiewicz [Sun, 25 Jul 2021 20:31:59 +0000 (20:31 +0000)]
Add workaround for Visual Studio not knowing about "inline".

2 years agoSwitch the Travis build to use osx_image: xcode12.5, in an attempt to avoid timeouts...
Eric Haszlakiewicz [Sun, 25 Jul 2021 20:03:55 +0000 (20:03 +0000)]
Switch the Travis build to use osx_image: xcode12.5, in an attempt to avoid timeouts with Homebrew.

2 years agoMerge some old work to include (some of) PR #464 into the current master branch.
Eric Haszlakiewicz [Sun, 25 Jul 2021 19:07:06 +0000 (19:07 +0000)]
Merge some old work to include (some of) PR #464 into the current master branch.

2 years agoOnly define an "uninstall" target if it's not already defined (e.g. by projects that...
Eric Haszlakiewicz [Sun, 25 Jul 2021 15:11:11 +0000 (15:11 +0000)]
Only define an "uninstall" target if it's not already defined (e.g. by projects that include json-c)

2 years agoMerge pull request #714 from Hex052/clang-format_AfterCaseLabel
Eric Hawicz [Mon, 5 Jul 2021 22:18:06 +0000 (18:18 -0400)]
Merge pull request #714 from Hex052/clang-format_AfterCaseLabel

Add AfterCaseLabel to .clang-format

2 years agoAdd AfterCaseLabel to .clang-format
Hex052 [Mon, 5 Jul 2021 02:28:21 +0000 (18:28 -0800)]
Add AfterCaseLabel to .clang-format

This is to fix the behavior that might've changed between older versions of clang-format, I'm not sure.
Version 10 tries to put the bracket on the same line as case without this.

2 years agoIf inttypes.h is present, use it, even on Windows.
Eric Haszlakiewicz [Sun, 13 Jun 2021 21:12:22 +0000 (21:12 +0000)]
If inttypes.h is present, use it, even on Windows.

2 years agoIssue #709: adjust some include guards to be a bit more json-c specific.
Eric Haszlakiewicz [Wed, 2 Jun 2021 23:53:23 +0000 (23:53 +0000)]
Issue #709: adjust some include guards to be a bit more json-c specific.

3 years agoMerge pull request #706 from davidjmccann/master
Eric Hawicz [Sat, 15 May 2021 12:41:24 +0000 (08:41 -0400)]
Merge pull request #706 from davidjmccann/master

Check __STDC_VERSION__ is defined before checking its value

3 years agoMerge branch 'json-c:master' into master
David McCann [Thu, 13 May 2021 05:34:10 +0000 (06:34 +0100)]
Merge branch 'json-c:master' into master

3 years agoCheck __STDC_VERSION__ is defined before checking its value
David McCann [Thu, 13 May 2021 05:31:18 +0000 (06:31 +0100)]
Check __STDC_VERSION__ is defined before checking its value

Prevent an undef warning regarding __STDC_VERSION__ by checking whether it is defined before checking its value.

3 years agoMerge pull request #696 from ssrlive/master
Eric Hawicz [Sat, 1 May 2021 19:21:31 +0000 (15:21 -0400)]
Merge pull request #696 from ssrlive/master

To avoid target exe file export JSON functions.

3 years agoMerge pull request #701 from commodo/configurable-opts
Eric Hawicz [Sat, 17 Apr 2021 21:26:49 +0000 (17:26 -0400)]
Merge pull request #701 from commodo/configurable-opts

[RFC] json_pointer: allow the feature to be disabled

3 years agojson_pointer: allow the feature to be disabled
Alexandru Ardelean [Fri, 16 Apr 2021 06:42:07 +0000 (09:42 +0300)]
json_pointer: allow the feature to be disabled

Some users may not want to included it in their build/system. So allow a
cmake symbol to disable it.

A user can do 'cmake -DDISABLE_JSON_POINTER=ON <json_c_root_dir>' and
disable the json_pointer functionality. That saves about 17 KB (on an
x86_64) machine. This may be useful on smaller embedded systems; even
though the saving would be fewer kilobytes.

One thing that also needs to change a bit, is that the 'json.h' be
autogenerated via cmake, in order to conditionally include that
"json_pointer.h" file.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
3 years agotests: CMakeLists.txt: move test names to variable
Alexandru Ardelean [Fri, 16 Apr 2021 06:32:07 +0000 (09:32 +0300)]
tests: CMakeLists.txt: move test names to variable

The intent is to be able to disable some features that get built into the
library. When we do that, we also need to disable some tests.

It's easier when adjusting a variable that contains the list of test names,
versus modifying the list in the foreach() statement.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
3 years agoMerge pull request #700 from Philosoph228/werror-fix
Eric Hawicz [Thu, 15 Apr 2021 02:38:36 +0000 (22:38 -0400)]
Merge pull request #700 from Philosoph228/werror-fix

Fix unused variable for Win32 build in random_seed.c

3 years agorandom_seed: fix unused variable for win32 build
Philosoph228 [Mon, 12 Apr 2021 19:12:35 +0000 (00:12 +0500)]
random_seed: fix unused variable for win32 build

3 years agoTo avoid target exe file export JSON functions.
ssrlive [Tue, 2 Mar 2021 06:27:40 +0000 (14:27 +0800)]
To avoid target exe file export JSON functions.

3 years agoAdd a DISABLE_EXTRA_LIBS option to skip using libbsd, per @neheb's request on issue...
Eric Haszlakiewicz [Mon, 15 Feb 2021 20:19:56 +0000 (20:19 +0000)]
Add a DISABLE_EXTRA_LIBS option to skip using libbsd, per @neheb's request on issue #692/commit 0f61f692.

3 years agoIf arc4random is used, don't bother compiling in the other fallback methods since...
Eric Haszlakiewicz [Sat, 13 Feb 2021 03:23:58 +0000 (03:23 +0000)]
If arc4random is used, don't bother compiling in the other fallback methods since they'll never be used.  Fixes PR#695 about unreachable code too.

3 years agoMerge pull request #694 from ihsinme/patch-1
Eric Hawicz [Sat, 6 Feb 2021 22:25:24 +0000 (17:25 -0500)]
Merge pull request #694 from ihsinme/patch-1

fix invalid unsigned arithmetic.

3 years agoUpdate json_object.c
ihsinme [Fri, 5 Feb 2021 15:58:20 +0000 (18:58 +0300)]
Update json_object.c

3 years agoIesue #692: use arc4random() if it's available (in libc on BSD systems, and libbsd...
Eric Haszlakiewicz [Wed, 13 Jan 2021 01:57:25 +0000 (01:57 +0000)]
Iesue #692: use arc4random() if it's available (in libc on BSD systems, and libbsd on Linux).

3 years agoKeep the doc directory in the nodoc release tarball, just exclude its contents.
Eric Haszlakiewicz [Wed, 13 Jan 2021 01:30:16 +0000 (01:30 +0000)]
Keep the doc directory in the nodoc release tarball, just exclude its contents.

3 years agoMerge pull request #674 from ploxiln/random_seed_err_continue
Eric Hawicz [Wed, 13 Jan 2021 01:22:54 +0000 (20:22 -0500)]
Merge pull request #674 from ploxiln/random_seed_err_continue

random_seed: on error, continue to next method

3 years agoMerge pull request #689 from neheb/patch-1
Eric Hawicz [Sat, 19 Dec 2020 02:30:14 +0000 (21:30 -0500)]
Merge pull request #689 from neheb/patch-1

fix compilation with clang

3 years agofix compilation with clang
Rosen Penev [Fri, 18 Dec 2020 03:59:37 +0000 (19:59 -0800)]
fix compilation with clang

Fixes the following warning:

json_pointer.c:230:7: warning: implicit declaration of function
    'vasprintf' is invalid in C99 [-Wimplicit-function-declaration]
            rc = vasprintf(&path_copy, path_fmt, args);

3 years agorandom_seed: on error, continue to next method
Pierce Lopez [Wed, 7 Oct 2020 05:22:30 +0000 (01:22 -0400)]
random_seed: on error, continue to next method

instead of exiting the process

3 years agoMerge pull request #667 from stoeckmann/regression
Eric Hawicz [Sat, 12 Sep 2020 00:56:51 +0000 (20:56 -0400)]
Merge pull request #667 from stoeckmann/regression

Fixed test1 regression.

3 years agoFixed test1 regression.
Tobias Stoeckmann [Fri, 11 Sep 2020 19:09:40 +0000 (21:09 +0200)]
Fixed test1 regression.

SIZEOF_SIZE_T might be only defined in config.h.

Include config.h for these systems to pass tests which are only
supposed to be run on 32 bit systems.

Fixes issue #666.

3 years agoMerge pull request #665 from stoeckmann/tokener
Eric Hawicz [Mon, 24 Aug 2020 13:51:41 +0000 (09:51 -0400)]
Merge pull request #665 from stoeckmann/tokener

Handle more allocation failures in json_tokener* functions

3 years agoMerge pull request #660 from stoeckmann/arraylist
Eric Hawicz [Mon, 24 Aug 2020 13:51:18 +0000 (09:51 -0400)]
Merge pull request #660 from stoeckmann/arraylist

Validate size arguments in arraylist functions.

3 years agoValidate size arguments in arraylist functions.
Tobias Stoeckmann [Sat, 22 Aug 2020 10:06:15 +0000 (12:06 +0200)]
Validate size arguments in arraylist functions.

The array_list_new2 function, which is externally reachable through
json_object_new_array_ext, does not check if specified initial size
actually fits into memory on 32 bit architectures.

It also allows negative values, which could lead to an overflow on these
architectures as well. I have added test cases for these situations.

While at it, also protect array_list_shrink against too large
empty_slots argument. No test added because it takes a huge length
value, therefore a lot of items within the array, to overflow the
calculation. In theory this affects 64 bit sytems as well, but since the
arraylist API is not supposed to be used by external applications
according to its header file, the call is protected due to int
limitation of json_object_array_shrink.

3 years agoMerge pull request #664 from stoeckmann/string
Eric Hawicz [Sun, 23 Aug 2020 20:43:31 +0000 (16:43 -0400)]
Merge pull request #664 from stoeckmann/string

Limit strings at INT_MAX length

3 years agoMerge pull request #663 from stoeckmann/strerror
Eric Hawicz [Sun, 23 Aug 2020 20:38:21 +0000 (16:38 -0400)]
Merge pull request #663 from stoeckmann/strerror

Properly format errnos in _json_c_strerror

3 years agoMerge pull request #662 from stoeckmann/random
Eric Hawicz [Sun, 23 Aug 2020 20:34:40 +0000 (16:34 -0400)]
Merge pull request #662 from stoeckmann/random

Prevent signed overflow in get_time_seed

3 years agoPrevent signed overflow in get_time_seed
Tobias Stoeckmann [Sat, 22 Aug 2020 11:23:23 +0000 (13:23 +0200)]
Prevent signed overflow in get_time_seed

Casting time(2) return value to int and multiplying the result with
such a constant will definitely lead to a signed overflow by this day.

Since signed overflows are undefined behaviour in C, avoid this.

Casting to unsigned is more than enough since the upper bits of a
64 bit time_t value will be removed with the int conversion anyway.

3 years agoHandle allocation failure in json_tokener_new_ex
Tobias Stoeckmann [Sat, 22 Aug 2020 11:18:10 +0000 (13:18 +0200)]
Handle allocation failure in json_tokener_new_ex

The allocation of printbuf_new might fail. Return NULL to indicate tis
error to the caller. Otherwise later usage of the returned tokener would
lead to null pointer dereference.

3 years agoCap string length at INT_MAX.
Tobias Stoeckmann [Sat, 22 Aug 2020 11:09:11 +0000 (13:09 +0200)]
Cap string length at INT_MAX.

Several issues occur if a string is longer than INT_MAX:

- The function json_object_get_string_len returns the length of a string
  as int. If the string is longer than INT_MAX, the result would be
  negative.
- That in turn would lead to possible out of boundary access when
  comparing these strings with memcmp and the returned length as done in
  json_object_equal.
- If json_escape_str is called with such strings, out of boundary
  accesses can occur due to internal int handling (also fixed).
- The string cannot be printed out due to printbuffer limits at
  INT_MAX (which is still true after this commit).

Such huge strings can only be inserted through API calls at this point
because input files are capped at INT_MAX anyway.

Due to huge amount of RAM needed to reproduce these issues I have not
added test cases.

3 years agoAligned comment in _json_object_new_string
Tobias Stoeckmann [Sat, 22 Aug 2020 11:07:45 +0000 (13:07 +0200)]
Aligned comment in _json_object_new_string

The comment only aligns correctly if tab size is 4. Replaced
spaces with tabs to stay in sync with style of other lines.

3 years agoProperly format errnos in _json_c_strerror
Tobias Stoeckmann [Sat, 22 Aug 2020 09:35:50 +0000 (11:35 +0200)]
Properly format errnos in _json_c_strerror

The function _json_c_strerror does not properly format unknown errnos.
The int to ascii loop ignores the leading digit if the number can be
divided by 10 and if an errno has been formatted, shorter errnos would
not properly terminate the newly created string, showing the ending
numbers of the previous output.

A test case has been added to show these effects.

Since this function has been introduced for tests, the effect of this on
real life code is basically non-existing. First an environment variable
has to be set to activate this strerror code and second an unknown errno
would have to be encountered.

3 years agoFix json_object_get_boolean() doc for the object and array cases (always returns...
Eric Haszlakiewicz [Mon, 17 Aug 2020 14:55:54 +0000 (14:55 +0000)]
Fix json_object_get_boolean() doc for the object and array cases (always returns 0), and add those cases to the test_cast test.
See also issue #658.

3 years agoMerge pull request #657 from stoeckmann/getrandom
Eric Hawicz [Sat, 15 Aug 2020 19:01:41 +0000 (15:01 -0400)]
Merge pull request #657 from stoeckmann/getrandom

Use GRND_NONBLOCK with getrandom.

3 years agoUse GRND_NONBLOCK with getrandom.
Tobias Stoeckmann [Sat, 15 Aug 2020 13:41:41 +0000 (15:41 +0200)]
Use GRND_NONBLOCK with getrandom.

The json-c library is used in cryptsetup for LUKS2 header information.
Since cryptsetup can be called very early during boot, the developers
avoid getrandom() calls in their own code base for now. [1]

Introducing a blocking getrandom() call in json-c therefore introduces
this issue for cryptsetup as well. Even though cryptsetup issues do not
have to be json-c issues, here is my proposal:

Let's use a non-blocking call, falling back to other sources if the call
would block. Since getrandom() accesses urandom, it must mean that we
are in an early boot phase -- otherwise the call would not block
according to its manual page.

As stated in manual page of random(4), accessing /dev/urandom won't
block but return weak random numbers, therefore this fallback would work
for json-c.

While at it, fixed the debug message.

[1] https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/47
    which references to https://lwn.net/Articles/800509/

3 years agoMerge pull request #656 from pogaram/fix-warnings
Eric Hawicz [Fri, 14 Aug 2020 20:57:32 +0000 (16:57 -0400)]
Merge pull request #656 from pogaram/fix-warnings

Fixed warnings

3 years agoFixed warnings
Aram Poghosyan [Fri, 14 Aug 2020 07:45:33 +0000 (11:45 +0400)]
Fixed warnings

3 years agoMerge pull request #655 from MarcT512/issue654
Eric Hawicz [Fri, 7 Aug 2020 14:18:30 +0000 (10:18 -0400)]
Merge pull request #655 from MarcT512/issue654

json_parse: Fix read past end of buffer

3 years agoFix read past end of buffer
Marc [Fri, 7 Aug 2020 09:49:45 +0000 (10:49 +0100)]
Fix read past end of buffer

Resolves https://github.com/json-c/json-c/issues/654

3 years agoEliminate use of ctype.h and replace isdigit() and tolower() with non-locale-sensitiv...
Eric Haszlakiewicz [Sun, 2 Aug 2020 04:06:44 +0000 (04:06 +0000)]
Eliminate use of ctype.h and replace isdigit() and tolower() with non-locale-sensitive approaches.

3 years agoNeither vertical tab nor formfeed are considered whitespace per the JSON spec, remove...
Eric Haszlakiewicz [Sun, 2 Aug 2020 03:59:56 +0000 (03:59 +0000)]
Neither vertical tab nor formfeed are considered whitespace per the JSON spec, remove them from is_ws_char().

3 years agoMerge the is_ws_char() and is_hex_char() changes to json_tokener from branch 'ramirop...
Eric Haszlakiewicz [Sun, 2 Aug 2020 02:54:36 +0000 (02:54 +0000)]
Merge the is_ws_char() and is_hex_char() changes to json_tokener from branch 'ramiropolla/for_upstream' (PR #464)

3 years agoTake a hint from PR #464 and use json_object_new_string_len() to avoid a needless...
Eric Haszlakiewicz [Sun, 2 Aug 2020 02:23:01 +0000 (02:23 +0000)]
Take a hint from PR #464 and use json_object_new_string_len() to avoid a needless extra strlen() call.
Also, create a _json_object_get_string_len() for internal use when we know
for sure the object we're dealing with is a json_type_string.

3 years agoMerge pull request #653 from lamby/966657-json-c-please-make-the-build-reproducible
Eric Hawicz [Sun, 2 Aug 2020 02:06:38 +0000 (22:06 -0400)]
Merge pull request #653 from lamby/966657-json-c-please-make-the-build-reproducible

Make the documentation build reproducibly

3 years agoMake the documentation build reproducibly
Chris Lamb [Sat, 1 Aug 2020 10:26:53 +0000 (11:26 +0100)]
Make the documentation build reproducibly

Whilst working on the Reproducible Builds effort [0] I noticed that
json-c could not be built reproducibly.

This is because it used the full, absolute path name as an (sanitised)
input to a filename, resulting in some binary package containing, for
example:

  /usr/share/doc/libjson-c-dev/html/md__build_1st_json-c-0_815_issues_closed_for_0_813.html
                                        ^^^^^^^^^^^^^^^^^^^^^^
or

  /usr/share/doc/libjson-c-dev/html/md__build_2_json-c-0_815_2nd_issues_closed_for_0_813.html
                                        ^^^^^^^^^^^^^^^^^^^^^^^^

These differing values are based on the path in which json-c is built. This was
originally filed in Debian as #966657 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/966657

3 years agoMerge pull request #651 from alanc/getrandom
Eric Hawicz [Sat, 1 Aug 2020 00:30:11 +0000 (20:30 -0400)]
Merge pull request #651 from alanc/getrandom

Getrandom

3 years agoUse getrandom() if available in json_c_get_random_seed
Alan Coopersmith [Thu, 30 Jul 2020 23:13:04 +0000 (16:13 -0700)]
Use getrandom() if available in json_c_get_random_seed

Lower overhead than opening & reading from /dev/urandom, and works
in chroots and other situtations where /dev/urandom is not available.
Falls back to existing methods when kernel doesn't support the syscall.

3 years agoIssue #649: Drop the generated doc/Doxyfile when creating a release.
Eric Haszlakiewicz [Tue, 28 Jul 2020 03:52:22 +0000 (03:52 +0000)]
Issue #649: Drop the generated doc/Doxyfile when creating a release.

3 years agoMerge pull request #650 from sartura/readme-update
Eric Hawicz [Mon, 27 Jul 2020 14:31:05 +0000 (10:31 -0400)]
Merge pull request #650 from sartura/readme-update

README: fix spelling errors

3 years agoREADME: fix spelling errors
Jakov Smolic [Mon, 27 Jul 2020 08:30:08 +0000 (10:30 +0200)]
README: fix spelling errors

Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
3 years agoInclude updating the json-c-current-releaes gh-pages symlink as part of the release...
Eric Haszlakiewicz [Sun, 26 Jul 2020 15:51:07 +0000 (15:51 +0000)]
Include updating the json-c-current-releaes gh-pages symlink as part of the release process.

3 years agoUpdate the master branch to version 0.15.99
Eric Haszlakiewicz [Sun, 26 Jul 2020 15:26:05 +0000 (15:26 +0000)]
Update the master branch to version 0.15.99

3 years agoUpdate AUTHORS, add issues_closed_for_0.15.md, tweak the release checklist slightly.
Eric Haszlakiewicz [Fri, 24 Jul 2020 03:17:13 +0000 (03:17 +0000)]
Update AUTHORS, add issues_closed_for_0.15.md, tweak the release checklist slightly.

3 years agoMerge pull request #648 from MarcT512/rbf
Eric Hawicz [Fri, 24 Jul 2020 02:26:58 +0000 (22:26 -0400)]
Merge pull request #648 from MarcT512/rbf

Fix "may be used uninitialized" Release build failure

3 years agoFix "may be used uninitialized" Release build failure
Marc [Thu, 23 Jul 2020 17:19:12 +0000 (18:19 +0100)]
Fix "may be used uninitialized" Release build failure

Fixes https://github.com/json-c/json-c/issues/647

3 years agoIssue #594 - provide an OVERRIDE_GET_RANDOM_SEED cmake variable to override json_c_ge...
Eric Haszlakiewicz [Wed, 22 Jul 2020 02:25:03 +0000 (02:25 +0000)]
Issue #594 - provide an OVERRIDE_GET_RANDOM_SEED cmake variable to override json_c_get_random_seed() for embedded platforms where time(NULL) doesn't work.

Example:
mkdir build && cd build
cmake -DOVERRIDE_GET_RANDOM_SEED='do { extern uint32_t getMsTicks(void); int ms = getMsTicks() * 433494437; return ms; } while(0)' ..

3 years agoMerge pull request #646 from pascal-cuoq/fix_645
Eric Hawicz [Wed, 22 Jul 2020 01:24:59 +0000 (21:24 -0400)]
Merge pull request #646 from pascal-cuoq/fix_645

Cast to unsigned char instead of int when calling tolower (Fixes #645)

3 years agoFixes #645
Pascal Cuoq [Tue, 21 Jul 2020 15:54:26 +0000 (17:54 +0200)]
Fixes #645

3 years agoUpdate the ChangeLog with recent changes, in preparation for a 0.15 release.
Eric Haszlakiewicz [Mon, 20 Jul 2020 03:39:01 +0000 (03:39 +0000)]
Update the ChangeLog with recent changes, in preparation for a 0.15 release.

3 years agoRemove the obsolete config.h.win32
Eric Haszlakiewicz [Fri, 17 Jul 2020 03:47:28 +0000 (03:47 +0000)]
Remove the obsolete config.h.win32

3 years agoFix a number of things with the generated docs, including translating triple-backtick...
Eric Haszlakiewicz [Fri, 17 Jul 2020 03:46:21 +0000 (03:46 +0000)]
Fix a number of things with the generated docs, including translating triple-backtick code blocks into a form doxygen understands.

3 years agoAdd some more detail about how to use json-c in README.md.
Eric Haszlakiewicz [Fri, 17 Jul 2020 03:42:38 +0000 (03:42 +0000)]
Add some more detail about how to use json-c in README.md.

3 years agoRemove the THIS_FUNCTION_IS_DEPRECATED define, we stopped using it long ago.
Eric Haszlakiewicz [Fri, 17 Jul 2020 03:20:29 +0000 (03:20 +0000)]
Remove the THIS_FUNCTION_IS_DEPRECATED define, we stopped using it long ago.

3 years agoRemove the obsolete README.json_object-split.md, and mark README.md as being the...
Eric Haszlakiewicz [Sun, 12 Jul 2020 19:16:19 +0000 (19:16 +0000)]
Remove the obsolete README.json_object-split.md, and mark README.md as being the doxygen mainpage.

3 years agoIssue #642: improve the docs for json_object_put() and json_object_get().
Eric Haszlakiewicz [Sun, 12 Jul 2020 18:43:27 +0000 (18:43 +0000)]
Issue #642: improve the docs for json_object_put() and json_object_get().

3 years agoExpand the doc for json_object_array_get_idx() to explain that it does not adjust...
Eric Haszlakiewicz [Sun, 12 Jul 2020 17:55:46 +0000 (17:55 +0000)]
Expand the doc for json_object_array_get_idx() to explain that it does not adjust refcounts.

3 years agoIssue #641: Add a cast to void * to address some theoretically undefined printf behavior.
Eric Haszlakiewicz [Sat, 11 Jul 2020 15:03:00 +0000 (15:03 +0000)]
Issue #641: Add a cast to void * to address some theoretically undefined printf behavior.

3 years agoIssue #642: improve docs for json_tokener.h and json_object_object_add().
Eric Haszlakiewicz [Sat, 11 Jul 2020 04:04:58 +0000 (04:04 +0000)]
Issue #642: improve docs for json_tokener.h and json_object_object_add().

3 years agoDon't export json-c symbols starting with an underscore, put deprecated exports into...
Eric Haszlakiewicz [Sat, 4 Jul 2020 18:58:56 +0000 (18:58 +0000)]
Don't export json-c symbols starting with an underscore, put deprecated exports into a "JSONC_PRIVATE" version, and note stuff to do during releases.
See also PR #639 and issue #621

3 years agoChange the strerror_override handling to check $_JSON_C_STRERROR_OVERRIDE instead...
Eric Haszlakiewicz [Sat, 4 Jul 2020 18:56:15 +0000 (18:56 +0000)]
Change the strerror_override handling to check $_JSON_C_STRERROR_OVERRIDE instead of using a variable, so we don't need to export it.

3 years agoMerge pull request #639 from smcv/symbol-versions
Eric Hawicz [Sat, 4 Jul 2020 18:26:20 +0000 (14:26 -0400)]
Merge pull request #639 from smcv/symbol-versions

build: Add a symbol version to all exported symbols

3 years agobuild: Add symbol versions to all exported symbols
Simon McVittie [Mon, 29 Jun 2020 17:16:34 +0000 (18:16 +0100)]
build: Add symbol versions to all exported symbols

With this version script, newly-linked binaries that depend on the
json-c shared library will refer to its symbols in a versioned form,
preventing their references from being resolved to a symbol of the same
name exported by json-glib or libjansson if those libraries appear in
dependency search order before json-c, which will usually result in
a crash. This is necessary because ELF symbol resolution normally uses
a single flat namespace, not a tree like Windows symbol resolution.
At least one symbol (json_object_iter_next()) is exported by all three
JSON libraries.

Linking with -Bsymbolic is not enough to have this effect in all cases,
because -Bsymbolic only affects symbol lookup within a shared object,
for example when json_object_set_serializer() calls
json_object_set_userdata(). It does not affect calls from external
code into json-c, unless json-c was statically linked into the
external caller.

This change will also not prevent code that depends on json-glib or
libjansson from finding json-c's symbols and crashing; to prevent
that, a corresponding change in json-glib or libjansson would be needed.

Adding a symbol-version is a backwards-compatible change, but once
added, removing or changing the symbol-version on a symbol would be an
incompatible change that requires a SONAME bump.

Resolves: https://github.com/json-c/json-c/issues/621
(when combined with an equivalent change to libjansson).

Signed-off-by: Simon McVittie <smcv@collabora.com>