Eric Hawicz
ac4dfa44cb
Merge pull request #782 from DimitriPapadopoulos/codespell
...
Fix typos found by codespell
2022-08-13 09:43:50 -04:00
Dimitri Papadopoulos
9462c0a7b5
Fix typos found by codespell
...
Do not fix typos from past commits found in release notes.
2022-08-13 15:47:40 +03:00
Eric Haszlakiewicz
bdd5e03d6e
Apply some of the fixes from PR #740 , although by using size_t instead of castings.
2022-07-31 19:28:48 +00:00
Eric Hawicz
4b0c6de760
Merge pull request #757 from c3h2-ctf/big
...
json_object_from_fd_ex: fail if file is too large
2022-07-31 14:27:32 -04:00
Eric Haszlakiewicz
253a5fa99d
Issue #705 : disable locale handling when building for a uClibc system because its duplocale() function (intentionally) crashes.
2022-07-30 20:27:35 +00:00
Eric Haszlakiewicz
9749b0cb66
When serializing with JSON_C_TO_STRING_PRETTY set, keep the opening and closing curly or square braces on same line for empty objects or arrays. Issue #778 .
2022-07-30 19:27:14 +00:00
Eric Haszlakiewicz
2e9b7456a5
Update Travis links to point at travis-ci.com instead of travis-ci.org
2022-07-26 23:47:58 +00:00
Eric Haszlakiewicz
5282e73600
Entirely drop mode bits from open(O_RDONLY) to avoid warnings on certain platforms. Fixes issue #779 .
2022-07-26 23:43:30 +00:00
Eric Haszlakiewicz
8b35a78d29
Trim a few travis builds, update others to more recent toolchains.
2022-07-24 20:37:14 +00:00
Eric Haszlakiewicz
22773b1e51
Fix the expected output for test_set_serializer.
2022-07-24 19:00:27 +00:00
Eric Haszlakiewicz
16208fc01a
Add test to check for the memory leak mentioned in issue #781
2022-07-24 18:59:26 +00:00
Eric Hawicz
2a2d861bc0
Merge pull request #781 from dddaniel/master
...
Fix memory leak with emtpy strings in json_object_set_string
2022-07-24 14:15:42 -04:00
Daniel Danzberger
213bb5caa1
Fix memory leak with emtpy strings in json_object_set_string
...
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 >
2022-07-24 19:03:49 +02:00
Eric Haszlakiewicz
d28ac67dde
Fix issue #775 - use a loop instead of list(TRANSFORM ...) to support cmake < 3.12.
2022-06-27 02:15:24 +00:00
Eric Hawicz
5d98f7825a
Merge pull request #776 from stoeckmann/typo
...
Fix typo
2022-06-21 21:39:00 -04:00
Tobias Stoeckmann
f63573460c
Fix typo
2022-06-21 14:39:01 +02:00
Eric Haszlakiewicz
6ee0a35a20
Fix #771/#768 by marking usage() as "noreturn" instead of using "FALLTHRU" in the case statement where it'd called.
2022-06-13 01:02:53 +00:00
Eric Hawicz
11546bfd07
Merge pull request #769 from An7ar35/issue-768
...
Issue #768
2022-06-03 23:14:16 -04:00
An7ar35
5d00384e0d
missing 'FALLTHRU' added to sort out error messages when using "-Werror=implicit-fallthrough" flag
2022-06-01 12:36:33 +02:00
Eric Haszlakiewicz
49c3721a5a
Unset NDEBUG so assert() is enabled in all tests. One more fix there when building with -DCMAKE_BUILD_TYPE=release.
2022-05-30 15:39:54 +00:00
Eric Haszlakiewicz
2f0942bdd7
Specify dependent libraries, including -lbsd, in a more consistent way so 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.
2022-05-30 15:30:11 +00:00
Eric Haszlakiewicz
6ba1adf8ef
Include the tests and apps directories at the _end_, since order in the
...
cmake rules matters, and fix compile warnings now that we're building
those sources with all the regular flags.
2022-05-30 14:33:16 +00:00
Eric Haszlakiewicz
86b46cac07
Add --disable-static and --disable-dynamic options to the cmake-configure script.
2022-05-30 14:31:08 +00:00
Eric Haszlakiewicz
f2fc1ca00a
Note the DSIABLE_JSON_POINTER and DISABLE_EXTRA_LIBS build options on the README
2022-04-14 12:57:43 +00:00
Eric Haszlakiewicz
acccefd770
Add a "Getting Help" section to the README.
2022-04-14 12:55:32 +00:00
Eric Haszlakiewicz
de5a64888a
Update the master branch to version 16.99
2022-04-14 12:29:39 +00:00
Eric Haszlakiewicz
7e3eba72db
Clarify how to set the uploaded release tarballs to be publically readable.
2022-04-14 12:17:59 +00:00
Eric Haszlakiewicz
7d303478a4
Update the ChangeLog with recent changes, in preparation for a 0.16 release.
...
Add a list of issues closed for this release.
2022-04-14 01:05:38 +00:00
Eric Haszlakiewicz
66dcdf549e
Add new authors since the 0.15 release, tweak instructions for how to update that list.
2022-04-14 01:04:53 +00:00
Eric Hawicz
4902f9cb87
Merge pull request #765 from jvoisin/patch-1
...
Improve a bit the coverage of the fuzzer
2022-04-13 14:28:51 -04:00
Julien Voisin
558d48a6f3
Improve a bit the coverage of the fuzzer
2022-04-13 15:42:46 +02:00
Eric Haszlakiewicz
46b58ad9e7
Fix issue #764 : adjust test_util_file to match new output (changed in 6e53347)
2022-04-08 22:58:24 +00:00
Eric Hawicz
0b937f6173
Merge pull request #758 from c3h2-ctf/context
...
Preserve context if out of memory
2022-04-04 18:01:39 -04:00
Eric Hawicz
65274cf3b5
Update issue templates
2022-04-04 17:10:31 -04:00
Tobias Stoeckmann
0c0d901443
Preserve context if out of memory
...
If memory allocation fails in json_c_set_serialization_double_format or
json_object_copy_serializer_data then return with an error value and
preserve previous values without overriding them with NULL.
2022-03-31 18:05:48 +02:00
Eric Haszlakiewicz
e244146dfd
Remove single quote from #error line. Fixes issue #761
2022-03-25 01:12:07 +00:00
Eric Hawicz
a1c092bd7b
Merge pull request #760 from BonsaiYi/error
...
Code style: removed unneeded double-quotes
2022-03-23 00:14:36 -04:00
BonsaY
716978f20d
Code style removed unneeded double-quotes
...
this way, it complies with the other #error usages
2022-03-21 21:10:45 +01:00
Tobias Stoeckmann
5accae04bb
json_object_from_fd_ex: fail if file is too large
...
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.
2022-03-20 13:17:37 +01:00
Eric Hawicz
79459b2de2
Merge pull request #755 from c3h2-ctf/error
...
Fix error messages
2022-03-19 10:05:48 -04:00
Eric Hawicz
2326e34390
Merge pull request #754 from c3h2-ctf/doc
...
Minor improvements to documentation
2022-03-19 10:04:58 -04:00
Tobias Stoeckmann
6e533471a8
Fix error messages
...
Error messages did not reflect actual function names.
2022-03-19 10:59:43 +01:00
Tobias Stoeckmann
a7d85bfba9
Fix typos in comments
...
Spotted during code reviews.
2022-03-19 10:39:56 +01:00
Tobias Stoeckmann
cbc603b587
Adjusted URLs
...
Most of these sites support HTTPS (some forward to HTTPS when accessing
the HTTP versions). Use HTTPS directly if supported.
Some URLs led to 404 error pages. Adjusted the links to point to
new locations.
I did not adjust the Microsoft HTML Help Workshop link because it seems
that this software is not available anymore. Instead of removing the
link entirely I kept it there in case it helps someone to find the
software on archived websites.
2022-03-19 10:34:55 +01:00
Eric Hawicz
f0d93cee14
Merge pull request #748 from c3h2-ctf/printbuf
...
sprintbuf(): test for all vsnprintf error values
2022-03-07 00:06:57 -05:00
Eric Hawicz
9b832c8710
Merge pull request #752 from c3h2-ctf/typos
...
Fix typos
2022-03-06 23:33:42 -05:00
Tobias Stoeckmann
543a8eb5f9
Fix typos
...
Mostly found with codespell and during code review.
2022-03-06 16:07:36 +01:00
Tobias Stoeckmann
94b2a0cb29
sprintbuf(): test for all vsnprintf error values
...
The POSIX specification states that vsnprintf returns "a negative value"
in case of error, but the code checks explicitly only for -1.
2022-03-06 16:05:32 +01:00
Eric Hawicz
a4389f4f30
Merge pull request #749 from c3h2-ctf/sprintbuf
...
sprintbuf(): handle printbuf_memappend errors
2022-03-03 21:32:09 -05:00
Eric Hawicz
4493db76d6
Merge pull request #750 from c3h2-ctf/clearmem
...
printbuf_memset(): set gaps to zero
2022-03-03 21:29:27 -05:00