Commit Graph
1462 Commits
Author SHA1 Message Date
Eric Hawicz 0ea5f6c615 Merge pull request #942 from dxbjavid/strerror-negative-oob
fix out-of-bounds read for negative errno in _json_c_strerror
2026-07-16 00:42:42 -04:00
Eric Hawicz f61e612b43 Merge pull request #943 from Seagate/meson_install_fix
fix installing json-c headers with meson and missing pkgconfig file
2026-07-16 00:41:29 -04:00
Eric Hawicz dfd37bc1bb Merge pull request #945 from arr2036/json-object-put-return-value
fix json_object_put() to return 1 for freed scalars and empty containers
2026-07-16 00:40:55 -04:00
Arran Cudbard-Bell 69be99ef8e fix json_object_put() to return 1 for freed scalars and empty containers
The iterative rewrite in 17328a67 made json_object_put() return 0 for freed scalars, strings and empty containers, contradicting the documented contract in json_object.h. Distinguish "freed" from "still referenced" in _json_object_put_maybe_free() and add regression tests.
2026-07-14 10:28:04 -04:00
Tyler Erickson 56a0e3f478 fix installing json-c headers with meson and missing pkgconfig file
This commit fixes the install path for json-c headers when running `meson install`.
Previously some showed in /usr/include/ rather than /usr/include/json-c

This also adds generating the pkgconfig .pc file for this project.

Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
2026-07-13 15:48:20 -06:00
Javid Khan 9d116a5d38 fix out-of-bounds read for negative errno in _json_c_strerror 2026-07-13 13:46:36 +05:30
Eric Hawicz e65444a258 Merge pull request #940 from dxbjavid/get-int64-double-boundary
reject out-of-range double in json_object_get_int64/get_uint64
2026-07-12 19:46:03 -04:00
Eric Hawicz aab792578b Issue #941: fix "defined but not used" errors when building with a c++ compiler. 2026-07-11 09:28:49 -04:00
Javid Khan 16e394ba96 reject out-of-range double in get_int64/get_uint64 2026-07-06 18:07:09 +05:30
Eric Hawicz 324e5ca593 Merge pull request #933 from dxbjavid/int-inc-int64min-overflow
fix signed overflow negating INT64_MIN in json_object_int_inc
2026-07-04 11:40:42 -04:00
Eric Hawicz 0c3a5a1994 Issue #934: Also set _userdata=NULL in _json_object_maybe_free() so json_object_put doesn't try to use it as a _delete_parent value.
Update the test_deep_nesting test output.
2026-07-04 11:39:02 -04:00
Eric Hawicz e00697585b Merge pull request #936 from dxbjavid/put-free-outside-assert
free objects outside assert() in json_object_put
2026-07-04 11:20:48 -04:00
Eric Hawicz 3aa996b5b6 Issue #934: Be sure to clear _user_delete in _json_object_put_maybe_free() to avoid calling it twice. Add a test to check. 2026-07-04 11:02:06 -04:00
Javid Khan f291fa81c6 free objects outside assert() in json_object_put 2026-06-30 18:54:06 +05:30
Javid Khan 54f5526011 fix signed overflow negating INT64_MIN in json_object_int_inc 2026-06-27 22:52:43 +05:30
Eric Hawicz b299553de1 Issue #824: start listing releases on github 2026-06-27 10:07:26 -04:00
Eric Hawicz c1c7e50e79 Update the master branch to version 0.19.99 2026-06-27 09:55:42 -04:00
Eric Hawicz c54e6900e7 More updates to ChangeLog for a 0.19 release 2026-06-27 09:35:37 -04:00
Eric Hawicz 3c1cf2b5a4 Merge pull request #931 from dxbjavid/patch-copy-deep-copy
deep copy values in json_patch copy op to avoid aliasing and cycles
2026-06-27 09:11:43 -04:00
Eric Hawicz d2adb47746 Merge pull request #932 from Alb3e3/harden-ci-permissions
ci: set least-privilege GITHUB_TOKEN permissions for meson workflow
2026-06-27 08:44:50 -04:00
Alb3e3 d0cc18738c ci: set least-privilege GITHUB_TOKEN permissions for meson workflow
The meson workflow only builds and tests across platforms; none of its
jobs write to the repository, packages, or other GitHub resources. Add a
workflow-level `permissions: { contents: read }` block so the default
GITHUB_TOKEN follows least privilege instead of inheriting the broad
read/write scopes granted by default.
2026-06-27 13:52:31 +02:00
dxbjavid 5647679c0c deep copy values in json_patch copy op to avoid aliasing and cycles 2026-06-24 21:56:36 +05:30
Eric Hawicz cce075f551 Merge pull request #930 from dxbjavid/get-double-locale-radix
fix locale-dependent strtod in json_object_get_double
2026-06-21 19:46:36 -04:00
Eric Hawicz e1812074fa Issue #928 - work around over-zealous uninitialized check in chromebrew gcc. 2026-06-21 19:25:37 -04:00
Eric Hawicz d9d8cab822 Add tests for the json_parse cli tool. 2026-06-21 13:44:59 -04:00
Eric Hawicz bb9c1238ad Save stderr from test output, allow for non-zero exit code from tests. 2026-06-21 13:43:11 -04:00
Eric Hawicz 1d658982e5 Issue #929: fix bad calculation of error offset when parsing in the apps/json_parse tool.
Also, show the failing character in hex to ensure error output is readable.
2026-06-21 12:43:20 -04:00
dxbjavid c6cd1f236c fix locale-dependent strtod in json_object_get_double 2026-06-15 23:53:53 +05:30
Eric Hawicz d1018cf6ba Update test_object_iterator.expect to match current test output. 2026-05-25 15:27:48 -04:00
Eric Hawicz 3e708e4c4f Drop osx from .travis.yml since macOS builds are no longer supported. 2026-05-24 16:15:19 -04:00
Eric Hawicz 6167807f3a Merge pull request #925 from mbroz/fix-build
Fix build with clang-21
2026-05-24 16:07:11 -04:00
Eric Hawicz dee128f4d6 Issue #927: update the documentation for json_object_iterator to clarify that any change of the fields present on the object being iterated invalidates the iterator.
Update the test to show what kind of changes _are_ allowed.
2026-05-23 14:31:45 -04:00
Eric Hawicz 2bfda7114b Remove never used struct json_object_iter_info_ 2026-05-23 14:31:45 -04:00
Eric Hawicz 79474075ce Fix expected output for test_deep_nesting 2026-05-23 14:31:45 -04:00
Milan Broz 1f7589fa2f Fix function prototypes in deep nesting test (clang compilation)
This patch fixes the build error with clang-21
  tests/test_deep_nesting.c:19:34: error: a function declaration
  without a prototype is deprecated in all versions of C
  [-Werror,-Wstrict-prototypes]
   19 | static char *generate_json_string()

by fixing generate_json_string() definition.

It also removes prototypes for static functions that are not needed.
2026-05-12 21:46:50 +02:00
Eric Hawicz ccd2803b3d Merge pull request #924 from json-c/put_no_recurse
avoid recursion during json_object_put
2026-05-03 20:49:09 -04:00
Eric Hawicz 17328a6713 Issue #923: Avoid stack recursion in json_object_put() so heavily nested object trees can be freed. 2026-05-03 20:44:28 -04:00
Eric Hawicz e50fb04154 Add lh_table_delete_entry_to_tail() and array_list_set_idx() functions. 2026-05-03 20:44:08 -04:00
Eric Hawicz 5320cf9753 Add a test to check for issues with deeply nested objects, which can cause problems due to stack recursion. 2026-05-03 20:44:02 -04:00
Eric Hawicz 52ddfb35f1 Fix memory leak in test_safe_json_pointer_set, the caller must free the passed value when json_pointer_set failed. Also, reformat. 2026-02-19 19:05:10 -05:00
Eric Hawicz 8c987e0b73 Issue #919: Fix build on non-x86 windows. Patch thanks to @dotanbrk 2026-02-19 18:48:05 -05:00
Eric Hawicz d7f14cb330 Merge pull request #917 from thely314/fix/oom-too-large-index
Fix: OOM vulnerability cause by is_valid_index
2026-02-14 17:23:49 -05:00
lone c293d9b61c general callback, safer API & related tests
- Changed json_pointer_set_with_array_cb to json_pointer_set_with_cb, related cb updated
- Added tests(test_safe_json_pointer_set.*) for new-exported funcs, also updated cmake & meson

Signed-off-by: lone <lonechan314@qq.com>
2026-02-09 14:01:38 +08:00
Eric Hawicz 8c01a7c32f Merge pull request #903 from neheb/1
meson / Linux-GCC (13) (push) Has been cancelled
meson / Linux-GCC (9) (push) Has been cancelled
meson / Linux-Clang (22) (push) Has been cancelled
meson / Linux-Clang (9) (push) Has been cancelled
meson / VisualStudio (x64) (push) Has been cancelled
meson / VisualStudio (x86) (push) Has been cancelled
meson / VisualStudio-clang-cl (push) Has been cancelled
meson / MSYS2 (CLANG64) (push) Has been cancelled
meson / MSYS2 (UCRT64) (push) Has been cancelled
meson / Cygwin (push) Has been cancelled
meson / MacOS (push) Has been cancelled
meson / DragonflyBSD (push) Has been cancelled
meson / FreeBSD (push) Has been cancelled
meson / NetBSD (push) Has been cancelled
meson / OmniOS (push) Has been cancelled
meson / OpenBSD (push) Has been cancelled
meson / Alpine (aarch64) (push) Has been cancelled
meson / Alpine (armhf) (push) Has been cancelled
meson / Alpine (armv7) (push) Has been cancelled
meson / Alpine (ppc64le) (push) Has been cancelled
meson / Alpine (riscv64) (push) Has been cancelled
meson / Alpine (s390x) (push) Has been cancelled
meson / Alpine (x86) (push) Has been cancelled
meson / Alpine (x86_64) (push) Has been cancelled
meson: use override_dependency
2026-02-08 17:08:04 -05:00
Rosen Penev d61b41c8bb github CI: add
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:46:00 -08:00
Rosen Penev 1d4885ad09 fix compilation with clang-cl
Something in the configure stage goes wrong where it believe strncasecmp
is present but the header defining it is not. Work around this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:46:00 -08:00
Rosen Penev 92a4911e88 meson: use static library for tests
Needed as tests use private APIs that are not exported.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:46:00 -08:00
Rosen Penev 798d8f7235 meson: add license information
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:21:54 -08:00
Rosen Penev a0c6bb32dd meson: simplify __thread check and fix MinGW
> was missing.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:21:54 -08:00
Rosen Penev af2671a212 meson: use override_dependency
Allows wraps to use the dependency_names syntax instead of the possibly
changing variable syntax.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:21:54 -08:00