]> granicus.if.org Git - json-c/log
json-c
4 years agoUse constants referring to the signed integer types when setting SSIZE_T_MAX.
Eric Haszlakiewicz [Wed, 1 Jul 2020 00:34:46 +0000 (00:34 +0000)]
Use constants referring to the signed integer types when setting SSIZE_T_MAX.
In practice, the sizes of the signed and unsigned integer types will
almost cetainly be the same, but this is more correct.
Pointed out in issue #638.

4 years agoReplace one call to json_object_new_array() with json_object_new_array_ext() to ensur...
Eric Haszlakiewicz [Mon, 29 Jun 2020 02:35:26 +0000 (02:35 +0000)]
Replace one call to json_object_new_array() with json_object_new_array_ext() to ensure it at least minimally works.

4 years agoAdd doc comment for json_object_new_array_ext().
Eric Haszlakiewicz [Mon, 29 Jun 2020 02:31:32 +0000 (02:31 +0000)]
Add doc comment for json_object_new_array_ext().

4 years agoFix code formatting
Eric Haszlakiewicz [Mon, 29 Jun 2020 02:31:18 +0000 (02:31 +0000)]
Fix code formatting

4 years agoMake sure TEST_PARSE_CHUNKSIZE is valid if it's set.
Eric Haszlakiewicz [Mon, 29 Jun 2020 02:18:34 +0000 (02:18 +0000)]
Make sure TEST_PARSE_CHUNKSIZE is valid if it's set.

4 years agoIn the json_tokener_state_number case, explicitly adjust what "number" characters...
Eric Haszlakiewicz [Mon, 29 Jun 2020 02:14:26 +0000 (02:14 +0000)]
In the json_tokener_state_number case, explicitly adjust what "number" characters are allowed based on the exact micro-state that we're in, and check for invalid following characters in a different way, to allow a valid json_type_number object to be returned at the top level.
This causes previously failing strings like "123-456" to return a valid json_object with the appropriate value.  If you care about the trailing content, call json_tokener_parse_ex() and check the parse end point with json_tokener_get_parse_end().

4 years agoFix incremental parsing of invalid numbers with exponents, such as "0e+-" and "12...
Eric Haszlakiewicz [Sat, 27 Jun 2020 15:32:19 +0000 (15:32 +0000)]
Fix incremental parsing of invalid numbers with exponents, such as "0e+-" and "12.3E12E12", while still allowing "0e+" in non-strict mode.
Deprecate the json_parse_double() function from json_util.h

4 years agoIssue #635: Fix "expression has no effect" warning in json_tokener.c by casting to...
Eric Haszlakiewicz [Tue, 23 Jun 2020 02:51:46 +0000 (02:51 +0000)]
Issue #635: Fix "expression has no effect" warning in json_tokener.c by casting to void.

4 years agoFix memory leak in test_parse's single_incremental_parse().
Eric Haszlakiewicz [Mon, 22 Jun 2020 01:12:03 +0000 (01:12 +0000)]
Fix memory leak in test_parse's single_incremental_parse().

4 years agoDrop extra blank lines from arraylist.h
Eric Haszlakiewicz [Sun, 21 Jun 2020 18:30:40 +0000 (18:30 +0000)]
Drop extra blank lines from arraylist.h

4 years agoIssue #616: Change the parsing of surrogate pairs in unicode escapes so it uses a...
Eric Haszlakiewicz [Sun, 21 Jun 2020 18:17:40 +0000 (18:17 +0000)]
Issue #616: Change the parsing of surrogate pairs in unicode escapes so it uses a couple of additional states instead of assuming the low surrogate is already present, to ensure that we correctly handle various cases of incremental parsing.

4 years agoIn test_parse, fix lengths passed during a couple of incremental tests.
Eric Haszlakiewicz [Sun, 21 Jun 2020 17:36:38 +0000 (17:36 +0000)]
In test_parse, fix lengths passed during a couple of incremental tests.
Add an optional way to use an incremental chunk size ($TEST_PARSE_CHUNKSIZE)
for all of the single_basic_parse tests, in additional to the regular way.

4 years agoRearrange the json_tokener_state_escape_unicode case in json_tokener to simplify...
Eric Haszlakiewicz [Sun, 21 Jun 2020 03:10:55 +0000 (03:10 +0000)]
Rearrange the json_tokener_state_escape_unicode case in json_tokener to simplify the code slightly and make it a bit easier to understand.
While here, drop the utf8_replacement_char that is unnecesarily added if we run out of input in the middle of a unicode escape.  No other functional changes (yet).

4 years agoUpdate the json_tokener_parse_ex() docs to clarify that the final '\0' character...
Eric Haszlakiewicz [Sun, 21 Jun 2020 02:35:42 +0000 (02:35 +0000)]
Update the json_tokener_parse_ex() docs to clarify that the final '\0' character is to be included in length passed in.

4 years agoMerge pull request #633 from dota17/issue616
Eric Hawicz [Sun, 21 Jun 2020 02:33:17 +0000 (22:33 -0400)]
Merge pull request #633 from dota17/issue616

fix issue 616: support the surrogate pair in split file.

4 years agoAdd json_object_array_shrink() (and array_list_shrink()) and use it in json_tokener...
Eric Haszlakiewicz [Sat, 20 Jun 2020 18:03:04 +0000 (18:03 +0000)]
Add json_object_array_shrink() (and array_list_shrink()) and use it in json_tokener to minimize the amount of memory used.  This results in a 39%-50% reduction in memory use (peak RSS, peak heap usage) on the jc-bench benchmark and 9% shorter runtime.
Also add the json_object_new_array_ext, array_list_new2, and array_list_shrink functions.

4 years agoMerge pull request #632 from json-c/json_object-split
Eric Hawicz [Sat, 20 Jun 2020 17:04:32 +0000 (13:04 -0400)]
Merge pull request #632 from json-c/json_object-split

Json object split

4 years agoReformat the json_object-split branch with clang-format json_object-split
Eric Haszlakiewicz [Tue, 16 Jun 2020 13:17:58 +0000 (13:17 +0000)]
Reformat the json_object-split branch with clang-format

4 years agoMerge pull request #634 from micahsnyder/json-c-fPIC
Eric Hawicz [Sun, 14 Jun 2020 21:56:35 +0000 (17:56 -0400)]
Merge pull request #634 from micahsnyder/json-c-fPIC

Issue #508: `-fPIC` to link libjson-c.a with libs

4 years agoIssue #508: `-fPIC` to link libjson-c.a with libs
Micah Snyder [Sun, 14 Jun 2020 16:01:48 +0000 (12:01 -0400)]
Issue #508: `-fPIC` to link libjson-c.a with libs

json-c has symbol collisions with other popular C JSON libraries.
To prevent random crashes in downstream applications that may use a
library which depends on json-c, the solution is to statically link
libjson-c.a into those libraries.

`-fPIC`/`-fPIE` is required when building a `.a` so it can be linked
into a `.so`.

4 years agoInclude unistd.h to fix the build on OSX
Eric Haszlakiewicz [Sun, 14 Jun 2020 03:11:44 +0000 (03:11 +0000)]
Include unistd.h to fix the build on OSX

4 years agoDrop the _delete field from struct json_object and call the type-specific delete...
Eric Haszlakiewicz [Sat, 13 Jun 2020 18:34:35 +0000 (18:34 +0000)]
Drop the _delete field from struct json_object and call the type-specific delete functions directly from json_object_put.  (Thanks @dota17 for the suggestion in PR #632!)

4 years agoDrop the useless "char data[1]" from struct json_object. Fix a typo in a comment.
Eric Haszlakiewicz [Sat, 13 Jun 2020 18:25:32 +0000 (18:25 +0000)]
Drop the useless "char data[1]" from struct json_object.  Fix a typo in a comment.

4 years agofix issue 616: support the surrogate pair in split file.
dota17 [Tue, 2 Jun 2020 11:17:42 +0000 (19:17 +0800)]
fix issue 616: support the surrogate pair in split file.

4 years agoEliminate unnecessary cast that was added to test_double_serializer.
Eric Haszlakiewicz [Sun, 7 Jun 2020 18:50:10 +0000 (18:50 +0000)]
Eliminate unnecessary cast that was added to test_double_serializer.

4 years agoSummarize the changes from the json_object-split branch in the ChangeLog.
Eric Haszlakiewicz [Sun, 7 Jun 2020 18:45:17 +0000 (18:45 +0000)]
Summarize the changes from the json_object-split branch in the ChangeLog.

4 years agoMove the ssize_t typedef from json_inttypes.h to json_object_private.h so as not...
Eric Haszlakiewicz [Sun, 7 Jun 2020 18:29:56 +0000 (18:29 +0000)]
Move the ssize_t typedef from json_inttypes.h to json_object_private.h so as not to affect publically exposed symbols.

4 years agoThe split of json_object into type-specific sub-structures is now functionally complete.
Eric Haszlakiewicz [Sun, 7 Jun 2020 03:30:39 +0000 (03:30 +0000)]
The split of json_object into type-specific sub-structures is now functionally complete.
Remove all of the temporary defines, structures, old compat fuctions, extra fields, etc... that were needed during the conversion to a split set of json_object_* structures.

4 years agoMore fixes for old MSVC builds.
Eric Haszlakiewicz [Sun, 7 Jun 2020 15:25:59 +0000 (15:25 +0000)]
More fixes for old MSVC builds.

4 years agoFix typo in previous commit to check for SSIZE_T on MSVC.
Eric Haszlakiewicz [Sun, 7 Jun 2020 15:19:29 +0000 (15:19 +0000)]
Fix typo in previous commit to check for SSIZE_T on MSVC.

4 years agoChange CMakeLists.txt to look for SSIZE_T on MSVC too.
Eric Haszlakiewicz [Sun, 7 Jun 2020 03:36:59 +0000 (03:36 +0000)]
Change CMakeLists.txt to look for SSIZE_T on MSVC too.

4 years agoOn MSVC, add a ssize_t typedef using SSIZE_T from BaseTsd.h
Eric Haszlakiewicz [Sun, 7 Jun 2020 03:27:13 +0000 (03:27 +0000)]
On MSVC, add a ssize_t typedef using SSIZE_T from BaseTsd.h

4 years agoKick json_type_string out of struct json_object.
Eric Haszlakiewicz [Sun, 7 Jun 2020 02:42:58 +0000 (02:42 +0000)]
Kick json_type_string out of struct json_object.
The default is now that string data is stored inline at the end of json_object, though to allow for json_object_set_string() to set a _longer_ string, we still need to allow for the possibility of a separate char * pointer.
All json types have been split out now, next step it cleanup.

4 years agoMerge pull request #628 from clamwin/compat-fixes-master
Eric Hawicz [Thu, 4 Jun 2020 03:53:46 +0000 (23:53 -0400)]
Merge pull request #628 from clamwin/compat-fixes-master

get_cryptgenrandom_seed: compat with old windows + fallback

4 years agoget_cryptgenrandom_seed: compat with old windows + fallback
Gianluigi Tiesi [Mon, 1 Jun 2020 18:49:08 +0000 (20:49 +0200)]
get_cryptgenrandom_seed: compat with old windows + fallback

4 years agoApply the fix from @pointbre in issue #626 to skip "inline" on AIX, but invert the...
Eric Haszlakiewicz [Sun, 31 May 2020 03:22:14 +0000 (03:22 +0000)]
Apply the fix from @pointbre in issue #626 to skip "inline" on AIX, but invert the test to make it a little easier to understand.

4 years agoIssue #626: Restore compatibility with cmake 2.8 by adjusting quoting and explicitly...
Eric Haszlakiewicz [Sat, 30 May 2020 19:36:54 +0000 (19:36 +0000)]
Issue #626: Restore compatibility with cmake 2.8 by adjusting quoting and explicitly defining the PROJECT_VERSION* variables.

4 years agoKick json_type_int and json_type_double out of struct json_object.
Eric Haszlakiewicz [Tue, 26 May 2020 02:31:35 +0000 (02:31 +0000)]
Kick json_type_int and json_type_double out of struct json_object.
Clean up the code in json_object_new_* a bit by dropping unnecesary json_object_base variables.

4 years agoDeclare variables earlier, to appease Visual Studio 2010.
Eric Haszlakiewicz [Mon, 25 May 2020 04:10:11 +0000 (04:10 +0000)]
Declare variables earlier, to appease Visual Studio 2010.

4 years agoKick json_type_boolean out of struct json_object.
Eric Haszlakiewicz [Mon, 25 May 2020 04:04:02 +0000 (04:04 +0000)]
Kick json_type_boolean out of struct json_object.

4 years agoAdd some backwards compat for Visual Studio 2013.
Eric Haszlakiewicz [Mon, 25 May 2020 03:52:36 +0000 (03:52 +0000)]
Add some backwards compat for Visual Studio 2013.

4 years agoKick json_type_array out of struct json_object; re-enable the test_deep_copy test.
Eric Haszlakiewicz [Mon, 25 May 2020 03:44:56 +0000 (03:44 +0000)]
Kick json_type_array out of struct json_object; re-enable the test_deep_copy test.

4 years agoStart splitting struct json_object into multiple sub-types, as descibed at https...
Eric Haszlakiewicz [Mon, 25 May 2020 03:14:06 +0000 (03:14 +0000)]
Start splitting struct json_object into multiple sub-types, as descibed at https://github.com/json-c/json-c/wiki/Proposal:-struct-json_object-split
The current changes split out _only_ json_type_object, and thus have a number of hacks
 to allow the code to continue to build and work.

Originally  mentioned in issue #535.
When complete, this will probably invalidate #552.
This is likely to cause notable conflicts in any other significant un-merged
changes, such as PR#620.

4 years agoIn arraylist, use malloc instead of calloc, avoid clearing with memeset until we...
Eric Haszlakiewicz [Sun, 24 May 2020 03:53:32 +0000 (03:53 +0000)]
In arraylist, use malloc instead of calloc, avoid clearing with memeset until we really need to, and micro-optimize array_list_add().

4 years agoMerge pull request #622 from besser82/topic/besser82/doc_subdir
Eric Hawicz [Mon, 18 May 2020 19:30:21 +0000 (15:30 -0400)]
Merge pull request #622 from besser82/topic/besser82/doc_subdir

doc: Move Doxyfile into doc subdir.

4 years agoCMake: Fix grammar: written -> wrote.
Björn Esser [Mon, 18 May 2020 18:36:05 +0000 (20:36 +0200)]
CMake: Fix grammar: written -> wrote.

4 years agodoc: Move Doxyfile into doc subdir
Björn Esser [Mon, 18 May 2020 18:32:35 +0000 (20:32 +0200)]
doc: Move Doxyfile into doc subdir

4 years agoWith the change in cc80203, Doxyfile no longer needs to be updated for a release.
Eric Haszlakiewicz [Mon, 18 May 2020 17:31:22 +0000 (17:31 +0000)]
With the change in cc80203, Doxyfile no longer needs to be updated for a release.

4 years agoMerge pull request #619 from besser82/topic/besser82/doxygen_oot
Eric Hawicz [Mon, 18 May 2020 17:30:13 +0000 (13:30 -0400)]
Merge pull request #619 from besser82/topic/besser82/doxygen_oot

CMake: Fix out-of-tree build for Doxygen documentation.

4 years agoMerge pull request #618 from besser82/topic/besser82/test_deep_copy
Eric Hawicz [Mon, 18 May 2020 17:29:21 +0000 (13:29 -0400)]
Merge pull request #618 from besser82/topic/besser82/test_deep_copy

test_deep_copy: Fix assertion value.

4 years agoCMake: Fix out-of-tree build for Doxygen documentation.
Björn Esser [Mon, 18 May 2020 16:20:01 +0000 (18:20 +0200)]
CMake: Fix out-of-tree build for Doxygen documentation.

4 years agotest_deep_copy: Fix assertion value.
Björn Esser [Mon, 18 May 2020 15:00:17 +0000 (17:00 +0200)]
test_deep_copy: Fix assertion value.

4 years agoMerge pull request #617 from besser82/topic/besser82/option_disable_tls
Eric Hawicz [Mon, 18 May 2020 14:25:54 +0000 (10:25 -0400)]
Merge pull request #617 from besser82/topic/besser82/option_disable_tls

Add an option to disable the use of thread-local storage.

4 years agoREADME: Update configuration options for CMake.
Björn Esser [Mon, 18 May 2020 10:39:38 +0000 (12:39 +0200)]
README: Update configuration options for CMake.

4 years agoCMake: Re-format config-option block and re-order it alphabetically.
Björn Esser [Mon, 18 May 2020 10:26:47 +0000 (12:26 +0200)]
CMake: Re-format config-option block and re-order it alphabetically.

4 years agoCMake: Add an option to disable the use of thread-local storage.
Björn Esser [Mon, 18 May 2020 09:38:58 +0000 (11:38 +0200)]
CMake: Add an option to disable the use of thread-local storage.

Using thread-local storage may not be desired in all environments
and/or use-cases, thus there should be an option to disable its use
on purpose.

Fixes #451.

4 years agotests: Fix test_double_serializer without thread-local storage.
Björn Esser [Mon, 18 May 2020 09:38:36 +0000 (11:38 +0200)]
tests: Fix test_double_serializer without thread-local storage.

4 years agoMerge pull request #614 from stoeckmann/format
Eric Hawicz [Sun, 17 May 2020 01:04:11 +0000 (21:04 -0400)]
Merge pull request #614 from stoeckmann/format

Prevent truncation on custom double formatters.

4 years agoUpdate issue templates
Eric Hawicz [Sun, 17 May 2020 00:55:20 +0000 (20:55 -0400)]
Update issue templates

4 years agoPrevent truncation on custom double formatters.
Tobias Stoeckmann [Sat, 16 May 2020 11:01:10 +0000 (13:01 +0200)]
Prevent truncation on custom double formatters.

A custom double formatter can lead to truncation of the rest of the
JSON document.

If a custom formatter completely fills the buffer used by snprintf
with a trailing dot or comma and the formatting option
JSON_C_TO_STRING_NOZERO has been specified, then an iterator moves
past the ending '\0' (off-by-one buffer overflow) to set an
additional '\0' and adds the first '\0' into the printbuf.

Since '\0' will eventually be considered the terminating character
of the complete printbuf result, all trailing characters are lost.

This leads to an incomplete JSON string as can be seen with the
test case.

The off-by-one can be noticed if compiled with address sanitizer.

Since this is a very special case and a malformed formatter could
do way more harm and is the responsibility of the user of this
library, this is just a protective measure to keep json-c code as
robust as possible.

4 years agoRevert part of PR#606 and use isnan/isinf again, but provide macro implementations...
Eric Haszlakiewicz [Sat, 16 May 2020 01:29:18 +0000 (01:29 +0000)]
Revert part of PR#606 and use isnan/isinf again, but provide macro implementations of those in math_compat.h is needed, as it seems to be on AIX and IBM i systems.

4 years agoMerge pull request #606 from davidjmccann/master
Eric Hawicz [Sat, 16 May 2020 01:15:18 +0000 (21:15 -0400)]
Merge pull request #606 from davidjmccann/master

Improved support for IBM operating systems

4 years agoImproved support for IBM operating systems
David McCann [Wed, 13 May 2020 14:57:54 +0000 (15:57 +0100)]
Improved support for IBM operating systems

Fix compiler errors and warnings when building on IBM operating systems such as AIX and IBM i.

4 years agoIssue #604: add check for __MINGW32__ in snprintf_compat.h
Eric Haszlakiewicz [Wed, 13 May 2020 14:53:05 +0000 (14:53 +0000)]
Issue #604: add check for __MINGW32__ in snprintf_compat.h

4 years agoDisplay a bit of info about what exactly we're benchmarking.
Eric Haszlakiewicz [Mon, 11 May 2020 03:03:43 +0000 (03:03 +0000)]
Display a bit of info about what exactly we're benchmarking.

4 years agoIgnore the bench/work and bench/data directories.
Eric Haszlakiewicz [Mon, 11 May 2020 01:24:46 +0000 (01:24 +0000)]
Ignore the bench/work and bench/data directories.

4 years agoMerge pull request #602 from ploxiln/parse_uint64_errno
Eric Hawicz [Mon, 11 May 2020 01:15:47 +0000 (21:15 -0400)]
Merge pull request #602 from ploxiln/parse_uint64_errno

fix json_parse_uint64() usage of errno

4 years agofix json_parse_uint64() usage of errno
Pierce Lopez [Sun, 10 May 2020 17:20:02 +0000 (13:20 -0400)]
fix json_parse_uint64() usage of errno

introduced in #542
fixes #601

4 years agoFix snprintf on windows problem for test4.
Eric Haszlakiewicz [Sun, 10 May 2020 04:04:28 +0000 (04:04 +0000)]
Fix snprintf on windows problem for test4.

4 years agoIssue #600: don't rename the static library on Windows, it _needs_ to have a differen...
Eric Haszlakiewicz [Sun, 10 May 2020 03:58:51 +0000 (03:58 +0000)]
Issue #600: don't rename the static library on Windows, it _needs_ to have a different name because the dll build also creates a "json-c.lib" file.

4 years agoRe-format after recent change to fix linkhash.
Eric Haszlakiewicz [Sun, 10 May 2020 03:58:27 +0000 (03:58 +0000)]
Re-format after recent change to fix linkhash.

4 years agoIssue #598: avoid building static libraries twice.
Eric Haszlakiewicz [Sun, 10 May 2020 03:48:45 +0000 (03:48 +0000)]
Issue #598: avoid building static libraries twice.

4 years agoIssue #599: Fix the backwards check in lh_table_insert_w_hash() that was preventing...
Eric Haszlakiewicz [Sun, 10 May 2020 03:32:19 +0000 (03:32 +0000)]
Issue #599: Fix the backwards check in lh_table_insert_w_hash() that was preventing adding more than 11 objects.
Add a test to check for this too.

4 years agoMerge branch 'master' of https://github.com/json-c/json-c
Eric Hawicz [Sat, 9 May 2020 02:25:15 +0000 (22:25 -0400)]
Merge branch 'master' of https://github.com/json-c/json-c

4 years agoMerge pull request #597 from ploxiln/json_parse_usage
Eric Hawicz [Sat, 9 May 2020 02:23:28 +0000 (22:23 -0400)]
Merge pull request #597 from ploxiln/json_parse_usage

json_parse demo: fix and use usage() function

4 years agojson_parse demo: fix and use usage() function
Pierce Lopez [Fri, 8 May 2020 22:27:35 +0000 (18:27 -0400)]
json_parse demo: fix and use usage() function

4 years agoMerge pull request #595 from dota17/static_shared
Eric Hawicz [Fri, 8 May 2020 03:23:15 +0000 (23:23 -0400)]
Merge pull request #595 from dota17/static_shared

Support to build both static and shared libraries

4 years agocmake-configure: fix enable-static option
hofnarr [Thu, 7 May 2020 23:27:06 +0000 (02:27 +0300)]
cmake-configure: fix enable-static option

4 years agocmake: change variable name
hofnarr [Thu, 7 May 2020 23:19:38 +0000 (02:19 +0300)]
cmake: change variable name

4 years agocmake: add list for build targets
hofnarr [Thu, 7 May 2020 23:16:52 +0000 (02:16 +0300)]
cmake: add list for build targets

4 years agoupdate
dota17 [Thu, 7 May 2020 06:50:43 +0000 (14:50 +0800)]
update

4 years agoMerge pull request #592 from stoeckmann/oob
Eric Hawicz [Thu, 7 May 2020 03:31:15 +0000 (23:31 -0400)]
Merge pull request #592 from stoeckmann/oob

Prevent out of boundary write on malicious input

4 years agoFix integer overflows.
Tobias Stoeckmann [Mon, 4 May 2020 17:47:25 +0000 (19:47 +0200)]
Fix integer overflows.

The data structures linkhash and printbuf are limited to 2 GB in size
due to a signed integer being used to track their current size.

If too much data is added, then size variable can overflow, which is
an undefined behaviour in C programming language.

Assuming that a signed int overflow just leads to a negative value,
like it happens on many sytems (Linux i686/amd64 with gcc), then
printbuf is vulnerable to an out of boundary write on 64 bit systems.

4 years agosupport to build both static and shared libraries
dota17 [Wed, 6 May 2020 02:48:53 +0000 (10:48 +0800)]
support to build both static and shared libraries

4 years agoPrevent division by zero in linkhash.
Tobias Stoeckmann [Mon, 4 May 2020 17:46:45 +0000 (19:46 +0200)]
Prevent division by zero in linkhash.

If a linkhash with a size of zero is created, then modulo operations
are prone to division by zero operations.

Purely protective measure against bad usage.

4 years agoProtect array_list_del_idx against size_t overflow.
Tobias Stoeckmann [Mon, 4 May 2020 17:41:16 +0000 (19:41 +0200)]
Protect array_list_del_idx against size_t overflow.

If the assignment of stop overflows due to idx and count being
larger than SIZE_T_MAX in sum, out of boundary access could happen.

It takes invalid usage of this function for this to happen, but
I decided to add this check so array_list_del_idx is as safe against
bad usage as the other arraylist functions.

4 years agoMake the benchmark work with pre-cmake versions of json-c. Fetch a few more data...
Eric Haszlakiewicz [Mon, 4 May 2020 03:40:40 +0000 (03:40 +0000)]
Make the benchmark work with pre-cmake versions of json-c.  Fetch a few more data files.

4 years agoIn jc-bench.sh, decode the --before and --after args. Use a separate data dir to...
Eric Haszlakiewicz [Mon, 4 May 2020 03:24:39 +0000 (03:24 +0000)]
In jc-bench.sh, decode the --before and --after args.  Use a separate data dir to avoid re-downloading files when the work dir is cleared.

4 years agoIssue #589: drop the rdrand test loops to just 3, tweak comments and add some links...
Eric Haszlakiewicz [Mon, 4 May 2020 01:29:02 +0000 (01:29 +0000)]
Issue #589: drop the rdrand test loops to just 3, tweak comments and add some links to bug reports, and decrease the nesting level of the has_rdrand() function.

4 years agoMerge pull request #589 from Xyene/detect-broken-rdrand
Eric Hawicz [Mon, 4 May 2020 01:13:48 +0000 (21:13 -0400)]
Merge pull request #589 from Xyene/detect-broken-rdrand

Detect broken RDRAND during initialization

4 years agoDetect broken RDRAND during initialization
Tudor Brindus [Sat, 2 May 2020 01:09:22 +0000 (21:09 -0400)]
Detect broken RDRAND during initialization

Some CPUs advertise RDRAND in CPUID, but return 0xFFFFFFFF
unconditionally. To avoid locking up later, test RDRAND during
initialization, and if it returns 0xFFFFFFFF, mark it as nonexistent.

Fixes #588.

4 years agoFix printf format issues in apps/json_parse, and actually call the usage() function.
Eric Hawicz [Sun, 3 May 2020 18:54:38 +0000 (14:54 -0400)]
Fix printf format issues in apps/json_parse, and actually call the usage() function.

4 years agoMerge pull request #590 from Xyene/fix-cpuid-segfault
Eric Hawicz [Sun, 3 May 2020 18:52:31 +0000 (14:52 -0400)]
Merge pull request #590 from Xyene/fix-cpuid-segfault

Fix segmentation fault in CPUID check

4 years agoFix segmentation fault in CPUID check
Tudor Brindus [Sat, 2 May 2020 02:24:20 +0000 (22:24 -0400)]
Fix segmentation fault in CPUID check

4 years agoFix cmake-configure to accept "--prefix=<foo>" in addition to "--prefix <foo>" (see...
Eric Haszlakiewicz [Sun, 3 May 2020 03:50:16 +0000 (03:50 +0000)]
Fix cmake-configure to accept "--prefix=<foo>" in addition to "--prefix <foo>" (see also Issue #591)

4 years agoAdd an initial version of a benchmarking harness for json-c, to be able to more easil...
Eric Haszlakiewicz [Mon, 27 Apr 2020 04:00:00 +0000 (04:00 +0000)]
Add an initial version of a benchmarking harness for json-c, to be able to more easily compare the performance of different library versions.

4 years agoExtend the CMakeLists.txt in the apps directory to be usable as a standalone build...
Eric Haszlakiewicz [Sun, 26 Apr 2020 04:02:36 +0000 (04:02 +0000)]
Extend the CMakeLists.txt in the apps directory to be usable as a standalone build, to link against other versions of json-c.
Tweak json_parse.c slightly to allow it to build against older json-c versions.

4 years agoThe json_parse command line app doesn't build on Windows, disable it.
Eric Haszlakiewicz [Tue, 21 Apr 2020 21:35:41 +0000 (21:35 +0000)]
The json_parse command line app doesn't build on Windows, disable it.

4 years agoAdd an apps directory, and a json_parse program to parse an input file and report...
Eric Haszlakiewicz [Tue, 21 Apr 2020 03:51:16 +0000 (03:51 +0000)]
Add an apps directory, and a json_parse program to parse an input file and report on memory usage.
This is intended to provide a way, during development, to test out the memory
and performance impacts of a change.

4 years agoAdd a JSON_TOKENER_ALLOW_TRAILING_CHARS flag for json_tokener_set_flags() to allow...
Eric Haszlakiewicz [Mon, 20 Apr 2020 16:06:34 +0000 (16:06 +0000)]
Add a JSON_TOKENER_ALLOW_TRAILING_CHARS flag for json_tokener_set_flags() to allow multiple objects to be parsed from input even when JSON_TOKENER_STRICT is set.