f43be0
# HG changeset patch
f43be0
# User Rob Lemley <rob@thunderbird.net>
f43be0
# Date 1663090875 0
f43be0
#      Tue Sep 13 17:41:15 2022 +0000
f43be0
# Node ID adfbf6378df82c8b2e087427a48ddc5cbe13aadd
f43be0
# Parent  fbc2cf15893e40959b04d22c9efa4d424aeb5c4f
f43be0
Bug 1790662 - Update json-c vendored source to 0.16. r=dandarnell
f43be0
f43be0
Differential Revision: https://phabricator.services.mozilla.com/D157961
f43be0
f43be0
diff --git a/comm/third_party/README.json-c b/comm/third_party/README.json-c
f43be0
--- a/comm/third_party/README.json-c
f43be0
+++ b/comm/third_party/README.json-c
f43be0
@@ -1,19 +1,20 @@
f43be0
-Directory ./json-c contains a copy of version 0.15 of the json-c library,
f43be0
-which has been obtained from https://s3.amazonaws.com/json-c_releases/releases/json-c-0.15-nodoc.tar.gz .
f43be0
+Directory ./json-c contains a copy of version 0.16 of the json-c library,
f43be0
+which has been obtained from https://s3.amazonaws.com/json-c_releases/releases/json-c-0.16-nodoc.tar.gz .
f43be0
 (Link at https://github.com/json-c/json-c/wiki).
f43be0
 
f43be0
 For licensing information, please refer to the included documentation.
f43be0
 
f43be0
 The SHA256SUM of the imported file is:
f43be0
-99bca4f944b8ced8ae0bbc6310d6a3528ca715e69541793a1ef51f8c5b4b0878  json-c-0.15-nodoc.tar.gz
f43be0
+ac8a3dd6820daaca579b23fbc74664310fbc3d67f52f6707cda67d21dde5570f  json-c-0.16-nodoc.tar.gz
f43be0
 
f43be0
 The following files and directories were removed from the source distribution's root:
f43be0
 .github/
f43be0
 apps/
f43be0
 bench/
f43be0
 cmake/
f43be0
+doc/
f43be0
 fuzz/
f43be0
 tests/
f43be0
 .clang-format
f43be0
 .editorconfig
f43be0
 .gitignore
f43be0
@@ -21,10 +22,12 @@ tests/
f43be0
 Android.configure.mk
f43be0
 CMakeLists.txt
f43be0
 README
f43be0
 appveyor.yml
f43be0
 cmake-configure
f43be0
+issues_closed_for_0.{13,14,15,16}.md
f43be0
+json_config.h.win32
f43be0
 json-c.pc.in
f43be0
 json-c.sym
f43be0
 
f43be0
 The following files were added to the source's root by MZLA Technologies:
f43be0
 config.h.in (modified copy from cmake/config.h.in)
f43be0
diff --git a/comm/third_party/json-c/AUTHORS b/comm/third_party/json-c/AUTHORS
f43be0
--- a/comm/third_party/json-c/AUTHORS
f43be0
+++ b/comm/third_party/json-c/AUTHORS
f43be0
@@ -1,30 +1,61 @@
f43be0
+Alan Coopersmith <alan.coopersmith@oracle.com>
f43be0
 Alexander Dahl <post@lespocky.de>
f43be0
+Alexandru Ardelean <ardeleanalex@gmail.com>
f43be0
 andy5995 <andy400-dev@yahoo.com>
f43be0
+Aram Poghosyan <Aram.Poghosyan@teamviewer.com>
f43be0
 Björn Esser <besser82@fedoraproject.org>
f43be0
+BonsaY <bonsay@posteo.de>
f43be0
 changyong guo <guo1487@163.com>
f43be0
 chenguoping <chenguopingdota@163.com>
f43be0
+Chris Lamb <lamby@debian.org>
f43be0
 Christopher Head <chead@chead.ca>
f43be0
 Chris Wolfe <chriswwolfe@gmail.com>
f43be0
 C. Watford (christopher.watford@gmail.com)
f43be0
 Darjan Krijan <darjan_krijan@gmx.de>
f43be0
+David McCann <mccannd@uk.ibm.com>
f43be0
+DeX77 <dex@dragonslave.de>
f43be0
+dota17 <chenguopingdota@163.com>
f43be0
+Eric Haszlakiewicz <erh+git@nimenees.com>
f43be0
 Eric Hawicz <erh+git@nimenees.com>
f43be0
+Even Rouault <even.rouault@spatialys.com>
f43be0
+Gianluigi Tiesi <sherpya@netfarm.it>
f43be0
 grdowns <grdowns@microsoft.com>
f43be0
+Hex052 <elijahiff@gmail.com>
f43be0
+hofnarr <hofnarr@hofnarr.fi>
f43be0
+ihsinme <61293369+ihsinme@users.noreply.github.com>
f43be0
 Ivan Romanov <drizt@land.ru>
f43be0
 Jaap Keuter <jaap.keuter@xs4all.nl>
f43be0
+Jakov Smolic <jakov.smolic@sartura.hr>
f43be0
 janczer <menshikov.ivn@gmail.com>
f43be0
 Jehan <jehan@girinstud.io>
f43be0
 Jehiah Czebotar <jehiah@gmail.com>
f43be0
 Jonathan Wiens <j.wiens@teles.com>
f43be0
 Jose Bollo <jose.bollo@iot.bzh>
f43be0
+José Bollo <jose.bollo@iot.bzh>
f43be0
+Juuso Alasuutari <juuso.alasuutari@gmail.com>
f43be0
 Keith Holman <keith.holman@windriver.com>
f43be0
+Kizuna-Meraki <z9@kizunameraki.de>
f43be0
+Leon Gross <leon.gross@rub.de>
f43be0
 Liang, Gao <liang.gao@intel.com>
f43be0
+Marc <34656315+MarcT512@users.noreply.github.com>
f43be0
 max <mpano91@gmail.com>
f43be0
+Micah Snyder <micasnyd@cisco.com>
f43be0
 Michael Clark <michael@metaparadigm.com>
f43be0
 myd7349 <myd7349@gmail.com>
f43be0
+Pascal Cuoq <cuoq@trust-in-soft.com>
f43be0
+Pawday <pawday@mail.ru>
f43be0
+Philosoph228 <philosoph228@gmail.com>
f43be0
 Pierce Lopez <pierce.lopez@gmail.com>
f43be0
 Po-Chuan Hsieh <sunpoet@sunpoet.net>
f43be0
 Ramiro Polla <ramiro.polla@gmail.com>
f43be0
 Rikard Falkeborn <rikard.falkeborn@gmail.com>
f43be0
+Robert Bielik <robert.bielik@dirac.com>
f43be0
 Robert <roby_p97@yahoo.com>
f43be0
+Rosen Penev <rosenp@gmail.com>
f43be0
 Rubasri Kalidas <rubasri.kalidas@intel.com>
f43be0
+Simon McVittie <smcv@collabora.com>
f43be0
+ssrlive <30760636+ssrlive@users.noreply.github.com>
f43be0
+Tobias Nießen <tniessen@users.noreply.github.com>
f43be0
+Tobias Stoeckmann <tobias@stoeckmann.org>
f43be0
+Tudor Brindus <me@tbrindus.ca>
f43be0
 Unmanned Player <36690541+unmanned-player@users.noreply.github.com>
f43be0
diff --git a/comm/third_party/json-c/ChangeLog b/comm/third_party/json-c/ChangeLog
f43be0
--- a/comm/third_party/json-c/ChangeLog
f43be0
+++ b/comm/third_party/json-c/ChangeLog
f43be0
@@ -1,8 +1,62 @@
f43be0
 
f43be0
-Next Release 0.15
f43be0
-=====================
f43be0
+0.16 (up to commit 66dcdf5, 2022-04-13)
f43be0
+========================================
f43be0
+
f43be0
+Deprecated and removed features:
f43be0
+--------------------------------
f43be0
+* JSON_C_OBJECT_KEY_IS_CONSTANT is deprecated in favor of
f43be0
+  JSON_C_OBJECT_ADD_CONSTANT_KEY
f43be0
+* Direct access to lh_table and lh_entry structure members is deprecated.  
f43be0
+  Use access functions instead, lh_table_head(), lh_entry_next(), etc...
f43be0
+* Drop REFCOUNT_DEBUG code.
f43be0
+
f43be0
+New features
f43be0
+------------
f43be0
+* The 0.16 release introduces no new features
f43be0
+
f43be0
+Build changes
f43be0
+-------------
f43be0
+* Add a DISABLE_EXTRA_LIBS option to skip using libbsd
f43be0
+* Add a DISABLE_JSON_POINTER option to skip compiling in json_pointer support.
f43be0
+
f43be0
+Significant changes and bug fixes
f43be0
+---------------------------------
f43be0
+* Cap string length at INT_MAX to avoid various issues with very long strings.
f43be0
+* json_object_deep_copy: fix deep copy of strings containing '\0'
f43be0
+* Fix read past end of buffer in the "json_parse" command
f43be0
+* Avoid out of memory accesses in the locally provided vasprintf() function
f43be0
+  (for those platforms that use it)
f43be0
+* Handle allocation failure in json_tokener_new_ex
f43be0
+* Fix use-after-free in json_tokener_new_ex() in the event of printbuf_new() returning NULL
f43be0
+* printbuf_memset(): set gaps to zero - areas within the print buffer which
f43be0
+  have not been initialized by using printbuf_memset
f43be0
+* printbuf: return -1 on invalid arguments (len < 0 or total buffer > INT_MAX)
f43be0
+* sprintbuf(): propagate printbuf_memappend errors back to the caller
f43be0
+
f43be0
+Optimizations
f43be0
+--------------
f43be0
+* Speed up parsing by replacing ctype functions with simplified, faster 
f43be0
+  non-locale-sensitive ones in json_tokener and json_object_to_json_string.
f43be0
+* Neither vertical tab nor formfeed are considered whitespace per the JSON spec
f43be0
+* json_object: speed up creation of objects, calloc() -> malloc() + set fields
f43be0
+* Avoid needless extra strlen() call in json_c_shallow_copy_default() and
f43be0
+  json_object_equal() when the object is known to be a json_type_string.
f43be0
+
f43be0
+Other changes
f43be0
+-------------
f43be0
+* Validate size arguments in arraylist functions.
f43be0
+* Use getrandom() if available; with GRND_NONBLOCK to allow use of json-c
f43be0
+  very early during boot, such as part of cryptsetup.
f43be0
+* Use arc4random() if it's available.
f43be0
+* random_seed: on error, continue to next method instead of exiting the process
f43be0
+* Close file when unable to read from /dev/urandom in get_dev_random_seed()
f43be0
+
f43be0
+***
f43be0
+
f43be0
+0.15 (up to commit 870965e, 2020/07/26)
f43be0
+========================================
f43be0
 
f43be0
 Deprecated and removed features:
f43be0
 --------------------------------
f43be0
 * Deprecate `array_list_new()` in favor of `array_list_new2()`
f43be0
 * Remove the THIS_FUNCTION_IS_DEPRECATED define.
f43be0
@@ -57,11 +111,11 @@ Significant changes and bug fixes
f43be0
 Other changes
f43be0
 -------------
f43be0
 * #589 - Detect broken RDRAND during initialization; also, fix segfault
f43be0
     in the CPUID check.
f43be0
 * #592 - Fix integer overflows to prevert out of bounds write on large input.
f43be0
-* Protect against division by zero in linkhash, when creaed with zero size.
f43be0
+* Protect against division by zero in linkhash, when created with zero size.
f43be0
 * #602 - Fix json_parse_uint64() internal error checking, leaving the retval
f43be0
     untouched in more failure cases.
f43be0
 * #614 - Prevent truncation when custom double formatters insert extra \0's
f43be0
 
f43be0
 
f43be0
@@ -183,11 +237,11 @@ Behavior changes:
f43be0
 	 See commit 99d8fc
f43be0
 
f43be0
 * Use size_t for array length and size.  Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible
f43be0
 	See commits 45c56b, 92e9a5 and others.
f43be0
 
f43be0
-* Check for failue when allocating memory, returning NULL and errno=ENOMEM.
f43be0
+* Check for failure when allocating memory, returning NULL and errno=ENOMEM.
f43be0
 	 See commit 2149a04.
f43be0
 
f43be0
 * Change json_object_object_add() return type from void to int, and will return -1 on failures, instead of exiting. (Note: this is not an ABI change)
f43be0
 
f43be0
 New features:
f43be0
@@ -374,11 +428,11 @@ 0.10
f43be0
   * Add json_object_object_get_ex(), a NULL-safe get object method, to be able
f43be0
      to distinguish between a key not present and the value being NULL.
f43be0
   * Add an alternative iterator implementation, see json_object_iterator.h
f43be0
   * Make json_object_iter public to enable external use of the
f43be0
      json_object_object_foreachC macro.
f43be0
-  * Add a printbuf_memset() function to provide an effecient way to set and
f43be0
+  * Add a printbuf_memset() function to provide an efficient way to set and
f43be0
      append things like whitespace indentation.
f43be0
   * Adjust json_object_is_type and json_object_get_type so they return
f43be0
       json_type_null for NULL objects and handle NULL passed to
f43be0
       json_objct_object_get().
f43be0
   * Rename boolean type to json_bool.
f43be0
@@ -460,11 +514,11 @@ 0.8
f43be0
     Geoffrey Young, geoff at modperlcookbook dot org
f43be0
 
f43be0
 0.7
f43be0
 ===
f43be0
   * Add escaping of backslash to json output
f43be0
-  * Add escaping of foward slash on tokenizing and output
f43be0
+  * Add escaping of forward slash on tokenizing and output
f43be0
   * Changes to internal tokenizer from using recursion to
f43be0
     using a depth state structure to allow incremental parsing
f43be0
 
f43be0
 0.6
f43be0
 ===
f43be0
diff --git a/comm/third_party/json-c/README.html b/comm/third_party/json-c/README.html
f43be0
--- a/comm/third_party/json-c/README.html
f43be0
+++ b/comm/third_party/json-c/README.html
f43be0
@@ -24,16 +24,16 @@
f43be0
 		
  • msbuild "json-c.vcxproj" /m /verbosity:normal /p:OutDir=lib\
  • f43be0
     		
  • Or, open the project in Visual Studio
  • f43be0
     		
    f43be0
     
    f43be0
     		

    Documentation

    f43be0
    -		

    Doxygen generated documentation exists here.

    f43be0
    +		

    Doxygen generated documentation exists here.

    f43be0
     
    f43be0
     		

    GIT Reposository

    f43be0
     		

    git clone https://github.com/json-c/json-c.git

    f43be0
     
    f43be0
    -		

    Mailing List

    f43be0
    +		

    Mailing List

    f43be0
                     <pi>Send email to json-c <at> googlegroups <dot> com

    f43be0
     
    f43be0
     		

    License

    f43be0
     		

    This program is free software; you can redistribute it and/or modify it under the terms of the MIT License.

    f43be0
     		
    f43be0
    diff --git a/comm/third_party/json-c/README.md b/comm/third_party/json-c/README.md
    f43be0
    --- a/comm/third_party/json-c/README.md
    f43be0
    +++ b/comm/third_party/json-c/README.md
    f43be0
    @@ -14,32 +14,39 @@ 6. [Linking to libjson-c](#linking)
    f43be0
     7. [Using json-c](#using)
    f43be0
     
    f43be0
     JSON-C - A JSON implementation in C 
    f43be0
     -----------------------------------
    f43be0
     
    f43be0
    +JSON-C implements a reference counting object model that allows you to easily
    f43be0
    +construct JSON objects in C, output them as JSON formatted strings and parse
    f43be0
    +JSON formatted strings back into the C representation of JSON objects.
    f43be0
    +It aims to conform to [RFC 7159](https://tools.ietf.org/html/rfc7159).
    f43be0
    +
    f43be0
    +Skip down to [Using json-c](#using)
    f43be0
    +or check out the [API docs](https://json-c.github.io/json-c/),
    f43be0
    +if you already have json-c installed and ready to use.
    f43be0
    +
    f43be0
    +Home page for json-c: https://github.com/json-c/json-c/wiki
    f43be0
    +
    f43be0
     Build Status
    f43be0
     * [AppVeyor Build](https://ci.appveyor.com/project/hawicz/json-c) ![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/json-c/json-c?branch=master&svg=true)
    f43be0
     * [Travis Build](https://travis-ci.org/json-c/json-c) ![Travis Build Status](https://travis-ci.org/json-c/json-c.svg?branch=master)
    f43be0
     
    f43be0
     Test Status
    f43be0
     * [Coveralls](https://coveralls.io/github/json-c/json-c?branch=master) [![Coverage Status](https://coveralls.io/repos/github/json-c/json-c/badge.svg?branch=master)](https://coveralls.io/github/json-c/json-c?branch=master)
    f43be0
     
    f43be0
    -JSON-C implements a reference counting object model that allows you to easily
    f43be0
    -construct JSON objects in C, output them as JSON formatted strings and parse
    f43be0
    -JSON formatted strings back into the C representation of JSON objects.
    f43be0
    -It aims to conform to [RFC 7159](https://tools.ietf.org/html/rfc7159).
    f43be0
    -
    f43be0
     Building on Unix with `git`, `gcc` and `cmake` 
    f43be0
     --------------------------------------------------
    f43be0
     
    f43be0
    -Home page for json-c: https://github.com/json-c/json-c/wiki
    f43be0
    +If you already have json-c installed, see [Linking to `libjson-c`](#linking)
    f43be0
    +for how to build and link your program against it.
    f43be0
     
    f43be0
     ### Prerequisites: 
    f43be0
     
    f43be0
      - `gcc`, `clang`, or another C compiler
    f43be0
     
    f43be0
    - - cmake>=2.8, >=3.16 recommended
    f43be0
    + - `cmake>=2.8`, `>=3.16` recommended, `cmake=>3.1` for tests
    f43be0
     
    f43be0
     To generate docs you'll also need:
    f43be0
      - `doxygen>=1.8.13`
    f43be0
     
    f43be0
     If you are on a relatively modern system, you'll likely be able to install
    f43be0
    @@ -78,11 +85,11 @@ Then:
    f43be0
     ```
    f43be0
     
    f43be0
     
    f43be0
     ### Generating documentation with Doxygen:
    f43be0
     
    f43be0
    -The libray documentation can be generated directly from the source codes using Doxygen tool:
    f43be0
    +The library documentation can be generated directly from the source code using Doxygen tool:
    f43be0
     
    f43be0
     ```sh
    f43be0
     # in build directory
    f43be0
     make doc
    f43be0
     google-chrome doc/html/index.html
    f43be0
    @@ -184,11 +191,11 @@ make USE_VALGRIND=0 test   # optionally 
    f43be0
     
    f43be0
     If a test fails, check `Testing/Temporary/LastTest.log`,
    f43be0
     `tests/testSubDir/${testname}/${testname}.vg.out`, and other similar files.
    f43be0
     If there is insufficient output try:
    f43be0
     ```sh
    f43be0
    -VERBOSE=1 make test
    f43be0
    +VERBOSE=1 CTEST_OUTPUT_ON_FAILURE=1 make test
    f43be0
     ```
    f43be0
     or
    f43be0
     ```sh
    f43be0
     JSONC_TEST_TRACE=1 make test
    f43be0
     ```
    f43be0
    @@ -218,42 +225,59 @@ then you can just add this to your `make
    f43be0
     ```make
    f43be0
     CFLAGS += $(shell pkg-config --cflags json-c)
    f43be0
     LDFLAGS += $(shell pkg-config --libs json-c)
    f43be0
     ```
    f43be0
     
    f43be0
    -Without `pkgconfig`, you would do something like this:
    f43be0
    +Without `pkgconfig`, you might do something like this:
    f43be0
     
    f43be0
     ```make
    f43be0
     JSON_C_DIR=/path/to/json_c/install
    f43be0
     CFLAGS += -I$(JSON_C_DIR)/include/json-c
    f43be0
    +# Or to use lines like: #include <json-c/json_object.h>
    f43be0
    +#CFLAGS += -I$(JSON_C_DIR)/include
    f43be0
     LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
    f43be0
     ```
    f43be0
     
    f43be0
    +If your project uses cmake:
    f43be0
    +
    f43be0
    +* Add to your CMakeLists.txt file:
    f43be0
    +
    f43be0
    +```cmake
    f43be0
    +find_package(json-c CONFIG)
    f43be0
    +target_link_libraries(${PROJECT_NAME} PRIVATE json-c::json-c)
    f43be0
    +```
    f43be0
    +
    f43be0
    +* Then you might run in your project:
    f43be0
    +
    f43be0
    +```sh
    f43be0
    +cd build
    f43be0
    +cmake -DCMAKE_PREFIX_PATH=/path/to/json_c/install/lib64/cmake ..
    f43be0
    +```
    f43be0
     
    f43be0
     Using json-c 
    f43be0
     ------------
    f43be0
     
    f43be0
    -To use json-c you can either include json.h, or preferrably, one of the
    f43be0
    +To use json-c you can either include json.h, or preferably, one of the
    f43be0
     following more specific header files:
    f43be0
     
    f43be0
     * json_object.h  - Core types and methods.
    f43be0
     * json_tokener.h - Methods for parsing and serializing json-c object trees.
    f43be0
     * json_pointer.h - JSON Pointer (RFC 6901) implementation for retrieving
    f43be0
                        objects from a json-c object tree.
    f43be0
     * json_object_iterator.h - Methods for iterating over single json_object instances.  (See also `json_object_object_foreach()` in json_object.h)
    f43be0
     * json_visit.h   - Methods for walking a tree of json-c objects.
    f43be0
    -* json_util.h    - Miscelleanous utility functions.
    f43be0
    +* json_util.h    - Miscellaneous utility functions.
    f43be0
     
    f43be0
    -For a full list of headers see [files.html](http://json-c.github.io/json-c/json-c-current-release/doc/html/files.html)
    f43be0
    +For a full list of headers see [files.html](https://json-c.github.io/json-c/json-c-current-release/doc/html/files.html)
    f43be0
     
    f43be0
     The primary type in json-c is json_object.  It describes a reference counted
    f43be0
     tree of json objects which are created by either parsing text with a
    f43be0
     json_tokener (i.e. `json_tokener_parse_ex()`), or by creating
    f43be0
     (with `json_object_new_object()`, `json_object_new_int()`, etc...) and adding
    f43be0
     (with `json_object_object_add()`, `json_object_array_add()`, etc...) them 
    f43be0
     individually.
    f43be0
    -Typically, every object in the tree will have one reference, from it's parent.
    f43be0
    +Typically, every object in the tree will have one reference, from its parent.
    f43be0
     When you are done with the tree of objects, you call json_object_put() on just
    f43be0
     the root object to free it, which recurses down through any child objects
    f43be0
     calling json_object_put() on each one of those in turn.
    f43be0
     
    f43be0
     You can get a reference to a single child 
    f43be0
    @@ -264,11 +288,11 @@ increment the child's refcount (`json_ob
    f43be0
     the parent being freed or it being removed from its parent
    f43be0
     (`json_object_object_del()` or `json_object_array_del_idx()`)
    f43be0
     
    f43be0
     When parsing text, the json_tokener object is independent from the json_object
    f43be0
     that it returns.  It can be allocated (`json_tokener_new()`)
    f43be0
    -used ones or multiple times (`json_tokener_parse_ex()`, and
    f43be0
    +used one or multiple times (`json_tokener_parse_ex()`, and
    f43be0
     freed (`json_tokener_free()`) while the json_object objects live on.
    f43be0
     
    f43be0
     A json_object tree can be serialized back into a string with 
    f43be0
     `json_object_to_json_string_ext()`.  The string that is returned 
    f43be0
     is only valid until the next "to_json_string" call on that same object.
    f43be0
    diff --git a/comm/third_party/json-c/RELEASE_CHECKLIST.txt b/comm/third_party/json-c/RELEASE_CHECKLIST.txt
    f43be0
    --- a/comm/third_party/json-c/RELEASE_CHECKLIST.txt
    f43be0
    +++ b/comm/third_party/json-c/RELEASE_CHECKLIST.txt
    f43be0
    @@ -18,11 +18,18 @@
    f43be0
             * https://github.com/lvc/abi-compliance-checker
    f43be0
             * If the new release is not backwards compatible, then this is a MAJOR release.
    f43be0
             * Mention removed features in ChangeLog
    f43be0
     		* Consider re-adding backwards compatible support, through symbol
    f43be0
     		  aliases and appropriate entries in json-c.sym
    f43be0
    +		* Be sure any new symbols are listed in json-c.sym as part of
    f43be0
    +		  the _new_ release version.
    f43be0
         * Update the AUTHORS file
    f43be0
    +
    f43be0
    +        PREV=$(git tag | tail -1)
    f43be0
    +        ( git log -r ${PREV}..HEAD | grep Author: | sed -e's/Author: //' ; cat AUTHORS ) | sort -u > A1
    f43be0
    +        mv A1 AUTHORS
    f43be0
    +
    f43be0
         * Exclude mentioning changes that have already been included in a point 
    f43be0
           release of the previous release branch.
    f43be0
     
    f43be0
     * Update ChangeLog with relevant notes before branching.
    f43be0
     
    f43be0
    @@ -31,18 +38,18 @@
    f43be0
     * Check that the compile works on Windows - automatic through AppVeyor
    f43be0
     
    f43be0
     ## Release creation
    f43be0
     
    f43be0
     Start creating the new release:
    f43be0
    -    release=0.15
    f43be0
    +    release=0.16
    f43be0
         git clone https://github.com/json-c/json-c json-c-${release}
    f43be0
     
    f43be0
         mkdir distcheck
    f43be0
         cd distcheck
    f43be0
         # Note, the build directory *must* be entirely separate from
    f43be0
         # the source tree for distcheck to work properly.
    f43be0
    -    cmake ../json-c-${release}
    f43be0
    +    cmake -DCMAKE_BUILD_TYPE=Release ../json-c-${release}
    f43be0
         make distcheck
    f43be0
         cd ..
    f43be0
     
    f43be0
     Make any fixes/changes *before* branching.
    f43be0
     
    f43be0
    @@ -53,11 +60,10 @@ Make any fixes/changes *before* branchin
    f43be0
     ------------
    f43be0
     
    f43be0
     Using ${release}:
    f43be0
     	Update the version in json_c_version.h
    f43be0
     	Update the version in CMakeLists.txt (VERSION in the project(...) line)
    f43be0
    -	Update the version in config.h.win32 (several places)
    f43be0
     
    f43be0
     Update the set_target_properties() line in CmakeLists.txt to set the shared
    f43be0
     library version.  Generally, unless we're doing a major release, change:
    f43be0
     	VERSION x.y.z
    f43be0
     to
    f43be0
    @@ -72,23 +78,25 @@ If we're doing a major release (SONAME b
    f43be0
     
    f43be0
     ------------
    f43be0
     
    f43be0
     Generate the doxygen documentation:
    f43be0
     
    f43be0
    -    doxygen
    f43be0
    +    (cd ../distcheck && make doc)
    f43be0
    +    cp -r -p ../distcheck/doc/{html,Doxyfile} doc/.
    f43be0
    +	rm doc/Doxyfile   # Remove generated file w/ hardcoded paths
    f43be0
         git add -f doc
    f43be0
    -    git commit doc
    f43be0
    +    git commit doc -m "Generate docs for the ${release} release"
    f43be0
     
    f43be0
     ------------
    f43be0
     
    f43be0
     Create the release tarballs:
    f43be0
     
    f43be0
         cd ..
    f43be0
         echo .git > excludes
    f43be0
         tar -czf json-c-${release}.tar.gz -X excludes json-c-${release}
    f43be0
     
    f43be0
    -    echo doc >> excludes
    f43be0
    +    echo 'doc/*' >> excludes
    f43be0
         tar -czf json-c-${release}-nodoc.tar.gz -X excludes json-c-${release}
    f43be0
     
    f43be0
     ------------
    f43be0
     
    f43be0
     Tag the branch:
    f43be0
    @@ -102,11 +110,11 @@ Tag the branch:
    f43be0
     ------------
    f43be0
     
    f43be0
     Go to Amazon S3 service at:
    f43be0
         https://console.aws.amazon.com/s3/
    f43be0
     
    f43be0
    -Upload the two tarballs in the json-c_releases folder.
    f43be0
    +Upload the two tarballs in the json-c_releases/releases folder.
    f43be0
     	When uploading, use "Standard" storage class, and make the uploaded files publicly accessible.
    f43be0
     
    f43be0
     Logout of Amazon S3, and verify that the files are visible.
    f43be0
         https://s3.amazonaws.com/json-c_releases/releases/index.html
    f43be0
     
    f43be0
    @@ -119,17 +127,18 @@ Post-release checklist:
    f43be0
     Add new section to ChangeLog for ${release}+1
    f43be0
     
    f43be0
     Use ${release}.99 to indicate a version "newer" than anything on the branch:
    f43be0
     	Update the version in json_c_version.h
    f43be0
     	Update the version in CMakeLists.txt
    f43be0
    -	Update the version in config.h.win32
    f43be0
     
    f43be0
     Update RELEASE_CHECKLIST.txt, set release=${release}+1
    f43be0
     
    f43be0
    +Add a new empty section to the json-c.sym file, for ${release}+1
    f43be0
    +
    f43be0
     Update the set_target_properties() line in CmakeLists.txt to match the release branch.
    f43be0
     
    f43be0
    -    git commit -a -m "Update the master branch to version 0.${release}.99"
    f43be0
    +    git commit -a -m "Update the master branch to version ${release}.99"
    f43be0
         git push
    f43be0
     
    f43be0
     ------------
    f43be0
     
    f43be0
     Update the gh-pages branch with new docs:
    f43be0
    @@ -141,10 +150,12 @@ Update the gh-pages branch with new docs
    f43be0
         git clone -b gh-pages https://github.com/json-c/json-c json-c-pages
    f43be0
         cd json-c-pages
    f43be0
         mkdir json-c-${release}
    f43be0
         cp -R ../json-c-${release}/doc json-c-${release}/.
    f43be0
         git add json-c-${release}
    f43be0
    +    rm json-c-current-release
    f43be0
    +    ln -s json-c-${release} json-c-current-release
    f43be0
         git commit -a -m "Add the ${release} docs."
    f43be0
     
    f43be0
         vi index.html
    f43be0
         # Add/change links to current release.
    f43be0
     
    f43be0
    diff --git a/comm/third_party/json-c/arraylist.c b/comm/third_party/json-c/arraylist.c
    f43be0
    --- a/comm/third_party/json-c/arraylist.c
    f43be0
    +++ b/comm/third_party/json-c/arraylist.c
    f43be0
    @@ -43,10 +43,12 @@ struct array_list *array_list_new(array_
    f43be0
     
    f43be0
     struct array_list *array_list_new2(array_list_free_fn *free_fn, int initial_size)
    f43be0
     {
    f43be0
     	struct array_list *arr;
    f43be0
     
    f43be0
    +	if (initial_size < 0 || (size_t)initial_size >= SIZE_T_MAX / sizeof(void *))
    f43be0
    +		return NULL;
    f43be0
     	arr = (struct array_list *)malloc(sizeof(struct array_list));
    f43be0
     	if (!arr)
    f43be0
     		return NULL;
    f43be0
     	arr->size = initial_size;
    f43be0
     	arr->length = 0;
    f43be0
    @@ -104,10 +106,12 @@ static int array_list_expand_internal(st
    f43be0
     int array_list_shrink(struct array_list *arr, size_t empty_slots)
    f43be0
     {
    f43be0
     	void *t;
    f43be0
     	size_t new_size;
    f43be0
     
    f43be0
    +	if (empty_slots >= SIZE_T_MAX / sizeof(void *) - arr->length)
    f43be0
    +		return -1;
    f43be0
     	new_size = arr->length + empty_slots;
    f43be0
     	if (new_size == arr->size)
    f43be0
     		return 0;
    f43be0
     	if (new_size > arr->size)
    f43be0
     		return array_list_expand_internal(arr, new_size);
    f43be0
    diff --git a/comm/third_party/json-c/arraylist.h b/comm/third_party/json-c/arraylist.h
    f43be0
    --- a/comm/third_party/json-c/arraylist.h
    f43be0
    +++ b/comm/third_party/json-c/arraylist.h
    f43be0
    @@ -13,12 +13,12 @@
    f43be0
      * @file
    f43be0
      * @brief Internal methods for working with json_type_array objects.
    f43be0
      *        Although this is exposed by the json_object_get_array() method,
    f43be0
      *        it is not recommended for direct use.
    f43be0
      */
    f43be0
    -#ifndef _arraylist_h_
    f43be0
    -#define _arraylist_h_
    f43be0
    +#ifndef _json_c_arraylist_h_
    f43be0
    +#define _json_c_arraylist_h_
    f43be0
     
    f43be0
     #ifdef __cplusplus
    f43be0
     extern "C" {
    f43be0
     #endif
    f43be0
     
    f43be0
    diff --git a/comm/third_party/json-c/config.h.in b/comm/third_party/json-c/config.h.in
    f43be0
    --- a/comm/third_party/json-c/config.h.in
    f43be0
    +++ b/comm/third_party/json-c/config.h.in
    f43be0
    @@ -55,10 +55,13 @@
    f43be0
     #undef HAVE_SYS_CDEFS_H
    f43be0
     
    f43be0
     /* Define to 1 if you have the <sys/param.h> header file. */
    f43be0
     #undef HAVE_SYS_PARAM_H
    f43be0
     
    f43be0
    +/* Define to 1 if you have the <sys/random.h> header file. */
    f43be0
    +#undef HAVE_SYS_RANDOM_H
    f43be0
    +
    f43be0
     /* Define to 1 if you have the <sys/resource.h> header file. */
    f43be0
     #undef HAVE_SYS_RESOURCE_H
    f43be0
     
    f43be0
     /* Define to 1 if you have the <sys/stat.h> header file. */
    f43be0
     #undef HAVE_SYS_STAT_H
    f43be0
    @@ -70,10 +73,16 @@
    f43be0
     #undef HAVE_UNISTD_H
    f43be0
     
    f43be0
     /* Define to 1 if you have the <xlocale.h> header file. */
    f43be0
     #undef HAVE_XLOCALE_H
    f43be0
     
    f43be0
    +/* Define to 1 if you have the <bsd/stdlib.h> header file. */
    f43be0
    +#undef HAVE_BSD_STDLIB_H
    f43be0
    +
    f43be0
    +/* Define to 1 if you have `arc4random' */
    f43be0
    +#undef HAVE_ARC4RANDOM
    f43be0
    +
    f43be0
     /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
    f43be0
     #undef HAVE_DOPRNT
    f43be0
     
    f43be0
     /* Has atomic builtins */
    f43be0
     #undef HAVE_ATOMIC_BUILTINS
    f43be0
    @@ -139,10 +148,13 @@
    f43be0
     #undef HAVE_VSNPRINTF
    f43be0
     
    f43be0
     /* Define to 1 if you have the `vsyslog' function. */
    f43be0
     #undef HAVE_VSYSLOG
    f43be0
     
    f43be0
    +/* Define if you have the `getrandom' function. */
    f43be0
    +#undef HAVE_GETRANDOM
    f43be0
    +
    f43be0
     /* Define if you have the `getrusage' function. */
    f43be0
     #undef HAVE_GETRUSAGE
    f43be0
     
    f43be0
     /* Have __thread */
    f43be0
     #undef HAVE___THREAD
    f43be0
    diff --git a/comm/third_party/json-c/debug.h b/third_party/json-c/deb/commug.h
    f43be0
    --- a/comm/third_party/json-c/debug.h
    f43be0
    +++ b/comm/third_party/json-c/debug.h
    f43be0
    @@ -12,21 +12,21 @@
    f43be0
     
    f43be0
     /**
    f43be0
      * @file
    f43be0
      * @brief Do not use, json-c internal, may be changed or removed at any time.
    f43be0
      */
    f43be0
    -#ifndef _DEBUG_H_
    f43be0
    -#define _DEBUG_H_
    f43be0
    +#ifndef _JSON_C_DEBUG_H_
    f43be0
    +#define _JSON_C_DEBUG_H_
    f43be0
     
    f43be0
     #include <stdlib.h>
    f43be0
     
    f43be0
     #ifdef __cplusplus
    f43be0
     extern "C" {
    f43be0
     #endif
    f43be0
     
    f43be0
     #ifndef JSON_EXPORT
    f43be0
    -#if defined(_MSC_VER)
    f43be0
    +#if defined(_MSC_VER) && defined(JSON_C_DLL)
    f43be0
     #define JSON_EXPORT __declspec(dllexport)
    f43be0
     #else
    f43be0
     #define JSON_EXPORT extern
    f43be0
     #endif
    f43be0
     #endif
    f43be0
    diff --git a/comm/third_party/json-c/issues_closed_for_0.13.md b/comm/third_party/json-c/issues_closed_for_0.13.md
    f43be0
    deleted file mode 100644
    f43be0
    --- a/comm/third_party/json-c/issues_closed_for_0.13.md
    f43be0
    +++ /dev/null
    f43be0
    @@ -1,270 +0,0 @@
    f43be0
    -
    f43be0
    -This list was created with:
    f43be0
    -
    f43be0
    -```
    f43be0
    -curl https://api.github.com/search/issues?q="repo%3Ajson-c%2Fjson-c+closed%3A>2014-04-10+created%3A<2017-12-01&sort=created&order=asc&per_page=400&page=1" > issues1.out
    f43be0
    -curl https://api.github.com/search/issues?q="repo%3Ajson-c%2Fjson-c+closed%3A>2014-04-10+created%3A<2017-12-01&sort=created&order=asc&per_page=400&page=2" > issues2.out
    f43be0
    -curl https://api.github.com/search/issues?q="repo%3Ajson-c%2Fjson-c+closed%3A>2014-04-10+created%3A<2017-12-01&sort=created&order=asc&per_page=400&page=3" > issues3.out
    f43be0
    -jq -r '.items[] | "[" + .title + "](" + .url + ")" | tostring' issues?.out  > issues.md
    f43be0
    -sed -e's,^\[ *\(.*\)\](https://api.github.com/.*/\([0-9].*\)),[Issue #\2](https://github.com/json-c/json-c/issues/\2) - \1,' -i issues.md
    f43be0
    -#... manual editing ...
    f43be0
    -```
    f43be0
    -
    f43be0
    -----
    f43be0
    -
    f43be0
    -Issues and Pull Requests closed for the 0.13 release
    f43be0
    -(since commit f84d9c, the 0.12 branch point, 2014-04-10)
    f43be0
    -
    f43be0
    -
    f43be0
    -* [Issue #61](https://github.com/json-c/json-c/issues/61) - Make json_object_object_add() indicate success or failure, test fix \
    f43be0
    -* [Issue #113](https://github.com/json-c/json-c/issues/113) - Build fixes (make dist and make distcheck) \
    f43be0
    -* [Issue #124](https://github.com/json-c/json-c/issues/124) - Fixing build \
    f43be0
    -* [Issue #125](https://github.com/json-c/json-c/issues/125) - Fix compile error(variable size set but not used) on g++4.6 \
    f43be0
    -* [Issue #126](https://github.com/json-c/json-c/issues/126) - Removed unused size variable. \
    f43be0
    -* [Issue #127](https://github.com/json-c/json-c/issues/127) - remove unused `size` variable \
    f43be0
    -* [Issue #128](https://github.com/json-c/json-c/issues/128) - Remove unused variable from json_tokenizer.c \
    f43be0
    -* [Issue #130](https://github.com/json-c/json-c/issues/130) - Failed to compile under Ubuntu 13.10 32bit \
    f43be0
    -* [Issue #131](https://github.com/json-c/json-c/issues/131) - undefined symbol: __sync_val_compare_and_swap_4 \
    f43be0
    -* [Issue #132](https://github.com/json-c/json-c/issues/132) - Remove unused variable 'size' \
    f43be0
    -* [Issue #133](https://github.com/json-c/json-c/issues/133) - Update and rename README to README.md \
    f43be0
    -* [Issue #134](https://github.com/json-c/json-c/issues/134) - Must remove variable size... \
    f43be0
    -* [Issue #135](https://github.com/json-c/json-c/issues/135) - bits.h uses removed json_tokener_errors\[error\] \
    f43be0
    -* [Issue #136](https://github.com/json-c/json-c/issues/136) - Error when running make check \
    f43be0
    -* [Issue #137](https://github.com/json-c/json-c/issues/137) - config.h.in should not be in git \
    f43be0
    -* [Issue #138](https://github.com/json-c/json-c/issues/138) - Can't build on RHEL 6.5 due to dependency on automake-1.14 \
    f43be0
    -* [Issue #140](https://github.com/json-c/json-c/issues/140) - Code bug in random_test.c evaluating same expression twice \
    f43be0
    -* [Issue #141](https://github.com/json-c/json-c/issues/141) - Removed duplicate check in random_seed test - bug #140 \
    f43be0
    -* [Issue #142](https://github.com/json-c/json-c/issues/142) - Please undeprecate json_object_object_get \
    f43be0
    -* [Issue #144](https://github.com/json-c/json-c/issues/144) - Introduce json_object_from_fd \
    f43be0
    -* [Issue #145](https://github.com/json-c/json-c/issues/145) - Handle % character properly \
    f43be0
    -* [Issue #146](https://github.com/json-c/json-c/issues/146) - TAGS rename \
    f43be0
    -* [Issue #148](https://github.com/json-c/json-c/issues/148) - Bump the soname \
    f43be0
    -* [Issue #149](https://github.com/json-c/json-c/issues/149) - SONAME bump \
    f43be0
    -* [Issue #150](https://github.com/json-c/json-c/issues/150) - Fix build using MinGW. \
    f43be0
    -* [Issue #151](https://github.com/json-c/json-c/issues/151) - Remove json_type enum trailing comma \
    f43be0
    -* [Issue #152](https://github.com/json-c/json-c/issues/152) - error while compiling json-c library version 0.11 \
    f43be0
    -* [Issue #153](https://github.com/json-c/json-c/issues/153) - improve doc for json_object_to_json_string() \
    f43be0
    -* [Issue #154](https://github.com/json-c/json-c/issues/154) - double precision \
    f43be0
    -* [Issue #155](https://github.com/json-c/json-c/issues/155) - add bsearch for arrays \
    f43be0
    -* [Issue #156](https://github.com/json-c/json-c/issues/156) - Remove trailing whitespaces \
    f43be0
    -* [Issue #157](https://github.com/json-c/json-c/issues/157) - JSON-C shall not exit on calloc fail. \
    f43be0
    -* [Issue #158](https://github.com/json-c/json-c/issues/158) - while using json-c 0.11, I am facing strange crash issue in json_object_put. \
    f43be0
    -* [Issue #159](https://github.com/json-c/json-c/issues/159) - json_tokener.c compile error \
    f43be0
    -* [Issue #160](https://github.com/json-c/json-c/issues/160) - missing header file on windows?? \
    f43be0
    -* [Issue #161](https://github.com/json-c/json-c/issues/161) - Is there a way to append to file? \
    f43be0
    -* [Issue #162](https://github.com/json-c/json-c/issues/162) - json_util: add directory check for POSIX distros \
    f43be0
    -* [Issue #163](https://github.com/json-c/json-c/issues/163) - Fix Win32 build problems \
    f43be0
    -* [Issue #164](https://github.com/json-c/json-c/issues/164) - made it compile and link on Widnows (as static library) \
    f43be0
    -* [Issue #165](https://github.com/json-c/json-c/issues/165) - json_object_to_json_string_ext length \
    f43be0
    -* [Issue #167](https://github.com/json-c/json-c/issues/167) - Can't build on Windows with Visual Studio 2010 \
    f43be0
    -* [Issue #168](https://github.com/json-c/json-c/issues/168) - Tightening the number parsing algorithm \
    f43be0
    -* [Issue #169](https://github.com/json-c/json-c/issues/169) - Doesn't compile on ubuntu 14.04, 64bit \
    f43be0
    -* [Issue #170](https://github.com/json-c/json-c/issues/170) - Generated files in repository \
    f43be0
    -* [Issue #171](https://github.com/json-c/json-c/issues/171) - Update configuration for VS2010 and win64 \
    f43be0
    -* [Issue #172](https://github.com/json-c/json-c/issues/172) - Adding support for parsing octal numbers \
    f43be0
    -* [Issue #173](https://github.com/json-c/json-c/issues/173) - json_parse_int64 doesn't work correctly at illumos \
    f43be0
    -* [Issue #174](https://github.com/json-c/json-c/issues/174) - Adding JSON_C_TO_STRING_PRETTY_TAB flag \
    f43be0
    -* [Issue #175](https://github.com/json-c/json-c/issues/175) - make check fails 4 tests with overflows when built with ASAN \
    f43be0
    -* [Issue #176](https://github.com/json-c/json-c/issues/176) - Possible to delete an array element at a given idx ? \
    f43be0
    -* [Issue #177](https://github.com/json-c/json-c/issues/177) - Fix compiler warnings \
    f43be0
    -* [Issue #178](https://github.com/json-c/json-c/issues/178) - Unable to compile on CentOS5 \
    f43be0
    -* [Issue #179](https://github.com/json-c/json-c/issues/179) - Added array_list_del_idx and json_object_array_del_idx \
    f43be0
    -* [Issue #180](https://github.com/json-c/json-c/issues/180) - Enable silent build by default \
    f43be0
    -* [Issue #181](https://github.com/json-c/json-c/issues/181) - json_tokener_parse_ex accepts invalid JSON \
    f43be0
    -* [Issue #182](https://github.com/json-c/json-c/issues/182) - Link against libm when needed \
    f43be0
    -* [Issue #183](https://github.com/json-c/json-c/issues/183) - Apply compile warning fix to master branch \
    f43be0
    -* [Issue #184](https://github.com/json-c/json-c/issues/184) - Use only GCC-specific flags when compiling with GCC \
    f43be0
    -* [Issue #185](https://github.com/json-c/json-c/issues/185) - compile error \
    f43be0
    -* [Issue #186](https://github.com/json-c/json-c/issues/186) - Syntax error \
    f43be0
    -* [Issue #187](https://github.com/json-c/json-c/issues/187) - array_list_get_idx and negative indexes. \
    f43be0
    -* [Issue #188](https://github.com/json-c/json-c/issues/188) - json_object_object_foreach warnings \
    f43be0
    -* [Issue #189](https://github.com/json-c/json-c/issues/189) - noisy json_object_from_file: error opening file \
    f43be0
    -* [Issue #190](https://github.com/json-c/json-c/issues/190) - warning: initialization discards const qualifier from pointer target type \[enabled by default\] \
    f43be0
    -* [Issue #192](https://github.com/json-c/json-c/issues/192) - json_tokener_parse  accepts invalid JSON {"key": "value" ,  } \
    f43be0
    -* [Issue #193](https://github.com/json-c/json-c/issues/193) - Make serialization format of doubles configurable \
    f43be0
    -* [Issue #194](https://github.com/json-c/json-c/issues/194) - Add utility function for comparing json_objects \
    f43be0
    -* [Issue #195](https://github.com/json-c/json-c/issues/195) - Call uselocale instead of setlocale \
    f43be0
    -* [Issue #196](https://github.com/json-c/json-c/issues/196) - Performance improvements \
    f43be0
    -* [Issue #197](https://github.com/json-c/json-c/issues/197) - Time for a new release? \
    f43be0
    -* [Issue #198](https://github.com/json-c/json-c/issues/198) - Fix possible memory leak and remove superfluous NULL checks before free() \
    f43be0
    -* [Issue #199](https://github.com/json-c/json-c/issues/199) - Fix build in Visual Studio \
    f43be0
    -* [Issue #200](https://github.com/json-c/json-c/issues/200) - Add build scripts for CI platforms \
    f43be0
    -* [Issue #201](https://github.com/json-c/json-c/issues/201) - disable forward-slash escaping? \
    f43be0
    -* [Issue #202](https://github.com/json-c/json-c/issues/202) - Array with objects support \
    f43be0
    -* [Issue #203](https://github.com/json-c/json-c/issues/203) - Add source position/coordinates to API \
    f43be0
    -* [Issue #204](https://github.com/json-c/json-c/issues/204) - json-c/json.h not found \
    f43be0
    -* [Issue #205](https://github.com/json-c/json-c/issues/205) - json-c Compiled with Visual Studios \
    f43be0
    -* [Issue #206](https://github.com/json-c/json-c/issues/206) - what do i use in place of json_object_object_get? \
    f43be0
    -* [Issue #207](https://github.com/json-c/json-c/issues/207) - Add support for property pairs directly added to arrays \
    f43be0
    -* [Issue #208](https://github.com/json-c/json-c/issues/208) - Performance enhancements (mainly) to json_object_to_json_string() \
    f43be0
    -* [Issue #209](https://github.com/json-c/json-c/issues/209) - fix regression from 2d549662be832da838aa063da2efa78ee3b99668 \
    f43be0
    -* [Issue #210](https://github.com/json-c/json-c/issues/210) - Use size_t for arrays \
    f43be0
    -* [Issue #211](https://github.com/json-c/json-c/issues/211) - Atomic updates for the refcount \
    f43be0
    -* [Issue #212](https://github.com/json-c/json-c/issues/212) - Refcount doesn't work between threads \
    f43be0
    -* [Issue #213](https://github.com/json-c/json-c/issues/213) - fix to compile with microsoft visual c++ 2010 \
    f43be0
    -* [Issue #214](https://github.com/json-c/json-c/issues/214) - Some non-GNU systems support __sync_val_compare_and_swap \
    f43be0
    -* [Issue #215](https://github.com/json-c/json-c/issues/215) - Build json-c for window 64 bit. \
    f43be0
    -* [Issue #216](https://github.com/json-c/json-c/issues/216) - configure: check realloc with AC_CHECK_FUNCS() to fix cross-compilation. \
    f43be0
    -* [Issue #217](https://github.com/json-c/json-c/issues/217) - Checking for functions in float.h \
    f43be0
    -* [Issue #218](https://github.com/json-c/json-c/issues/218) - Use a macro to indicate C99 to the compiler \
    f43be0
    -* [Issue #219](https://github.com/json-c/json-c/issues/219) - Fix various potential null ptr deref and int32 overflows \
    f43be0
    -* [Issue #220](https://github.com/json-c/json-c/issues/220) - Add utility function for comparing json_objects \
    f43be0
    -* [Issue #221](https://github.com/json-c/json-c/issues/221) - JSON_C_TO_STRING_NOSLASHESCAPE works incorrectly \
    f43be0
    -* [Issue #222](https://github.com/json-c/json-c/issues/222) - Fix issue #221: JSON_C_TO_STRING_NOSLASHESCAPE works incorrectly \
    f43be0
    -* [Issue #223](https://github.com/json-c/json-c/issues/223) - Clarify json_object_get_string documentation of NULL handling & return \
    f43be0
    -* [Issue #224](https://github.com/json-c/json-c/issues/224) - json_tokener.c - all warnings being treated as errors \
    f43be0
    -* [Issue #225](https://github.com/json-c/json-c/issues/225) - Hi, will you support clib as a "registry"? \
    f43be0
    -* [Issue #227](https://github.com/json-c/json-c/issues/227) - Bump SOVERSION to 3 \
    f43be0
    -* [Issue #228](https://github.com/json-c/json-c/issues/228) - avoid double slashes from json \
    f43be0
    -* [Issue #229](https://github.com/json-c/json-c/issues/229) - configure fails: checking size of size_t... configure: error: cannot determine a size for size_t \
    f43be0
    -* [Issue #230](https://github.com/json-c/json-c/issues/230) - Use stdint.h to check for size_t size \
    f43be0
    -* [Issue #231](https://github.com/json-c/json-c/issues/231) - Fix size_t size check for first-time builds \
    f43be0
    -* [Issue #232](https://github.com/json-c/json-c/issues/232) - tests/tests1: fix printf format for size_t arguments \
    f43be0
    -* [Issue #233](https://github.com/json-c/json-c/issues/233) - Include stddef.h in json_object.h \
    f43be0
    -* [Issue #234](https://github.com/json-c/json-c/issues/234) - Add public API to use userdata independently of custom serializer \
    f43be0
    -* [Issue #235](https://github.com/json-c/json-c/issues/235) - Undefined symbols Error for architecture x86_64 on Mac \
    f43be0
    -* [Issue #236](https://github.com/json-c/json-c/issues/236) - Building a project which uses json-c with flag -Wcast-qual causes compilation errors \
    f43be0
    -* [Issue #237](https://github.com/json-c/json-c/issues/237) - handle escaped utf-8 \
    f43be0
    -* [Issue #238](https://github.com/json-c/json-c/issues/238) - linkhash.c: optimised the table_free path \
    f43be0
    -* [Issue #239](https://github.com/json-c/json-c/issues/239) - initialize null terminator of new printbuf \
    f43be0
    -* [Issue #240](https://github.com/json-c/json-c/issues/240) - Compile error: Variable set but not used \
    f43be0
    -* [Issue #241](https://github.com/json-c/json-c/issues/241) - getting error in date string 19\/07\/2016, fixed for error 19/07/2016 \
    f43be0
    -* [Issue #242](https://github.com/json-c/json-c/issues/242) - json_tokener_parse error \
    f43be0
    -* [Issue #243](https://github.com/json-c/json-c/issues/243) - Fix #165 \
    f43be0
    -* [Issue #244](https://github.com/json-c/json-c/issues/244) - Error while compiling source from RHEL5, could you please help me to fix this \
    f43be0
    -* [Issue #245](https://github.com/json-c/json-c/issues/245) - json-c compile in window xp \
    f43be0
    -* [Issue #246](https://github.com/json-c/json-c/issues/246) - Mac: uselocale failed to build \
    f43be0
    -* [Issue #247](https://github.com/json-c/json-c/issues/247) - json_object_array_del_idx function has segment fault error? \
    f43be0
    -* [Issue #248](https://github.com/json-c/json-c/issues/248) - Minor changes in C source code \
    f43be0
    -* [Issue #249](https://github.com/json-c/json-c/issues/249) - Improving README \
    f43be0
    -* [Issue #250](https://github.com/json-c/json-c/issues/250) - Improving .gitignore \
    f43be0
    -* [Issue #251](https://github.com/json-c/json-c/issues/251) - Adding a file for EditorConfig \
    f43be0
    -* [Issue #252](https://github.com/json-c/json-c/issues/252) - Very minor changes not related to C source code \
    f43be0
    -* [Issue #253](https://github.com/json-c/json-c/issues/253) - Adding a test with cppcheck for Travis CI \
    f43be0
    -* [Issue #254](https://github.com/json-c/json-c/issues/254) - Very minor changes to some tests \
    f43be0
    -* [Issue #255](https://github.com/json-c/json-c/issues/255) - Minor changes in C source code \
    f43be0
    -* [Issue #256](https://github.com/json-c/json-c/issues/256) - Mailing list dead? \
    f43be0
    -* [Issue #257](https://github.com/json-c/json-c/issues/257) - Defining a coding style \
    f43be0
    -* [Issue #258](https://github.com/json-c/json-c/issues/258) - Enable CI services \
    f43be0
    -* [Issue #259](https://github.com/json-c/json-c/issues/259) - Fails to parse valid json \
    f43be0
    -* [Issue #260](https://github.com/json-c/json-c/issues/260) - Adding an object to itself \
    f43be0
    -* [Issue #261](https://github.com/json-c/json-c/issues/261) - Lack of proper documentation \
    f43be0
    -* [Issue #262](https://github.com/json-c/json-c/issues/262) - Add Cmakefile and fix compiler warning. \
    f43be0
    -* [Issue #263](https://github.com/json-c/json-c/issues/263) - Compiler Warnings with VS2015 \
    f43be0
    -* [Issue #264](https://github.com/json-c/json-c/issues/264) - successed in simple test   while failed in my project \
    f43be0
    -* [Issue #265](https://github.com/json-c/json-c/issues/265) - Conformance report for reference \
    f43be0
    -* [Issue #266](https://github.com/json-c/json-c/issues/266) - crash perhaps related to reference counting \
    f43be0
    -* [Issue #267](https://github.com/json-c/json-c/issues/267) - Removes me as Win32 maintainer, because I'm not. \
    f43be0
    -* [Issue #268](https://github.com/json-c/json-c/issues/268) - Documentation of json_object_to_json_string gives no information about memory management \
    f43be0
    -* [Issue #269](https://github.com/json-c/json-c/issues/269) - json_object_<type>_set(json_object *o,<type> value) API for value setting in json object private structure \
    f43be0
    -* [Issue #270](https://github.com/json-c/json-c/issues/270) - new API json_object_new_double_f(doubel d,const char * fmt); \
    f43be0
    -* [Issue #271](https://github.com/json-c/json-c/issues/271) - Cannot compile using CMake on macOS \
    f43be0
    -* [Issue #273](https://github.com/json-c/json-c/issues/273) - fixed wrong object name in json_object_all_values_equal \
    f43be0
    -* [Issue #274](https://github.com/json-c/json-c/issues/274) - Support for 64 bit pointers on Windows \
    f43be0
    -* [Issue #275](https://github.com/json-c/json-c/issues/275) - Out-of-bounds read in json_tokener_parse_ex \
    f43be0
    -* [Issue #276](https://github.com/json-c/json-c/issues/276) - ./configure for centos release 6.7(final) failure \
    f43be0
    -* [Issue #277](https://github.com/json-c/json-c/issues/277) - Json object set xxx \
    f43be0
    -* [Issue #278](https://github.com/json-c/json-c/issues/278) - Serialization of double with no fractional component drops trailing zero \
    f43be0
    -* [Issue #279](https://github.com/json-c/json-c/issues/279) - Segmentation fault in array_list_length() \
    f43be0
    -* [Issue #280](https://github.com/json-c/json-c/issues/280) - Should json_object_array_get_idx  check whether input obj is array? \
    f43be0
    -* [Issue #281](https://github.com/json-c/json-c/issues/281) - how to pretty print json-c? \
    f43be0
    -* [Issue #282](https://github.com/json-c/json-c/issues/282) - ignore temporary files \
    f43be0
    -* [Issue #283](https://github.com/json-c/json-c/issues/283) - json_pointer: add first revision based on RFC 6901 \
    f43be0
    -* [Issue #284](https://github.com/json-c/json-c/issues/284) - Resusing  json_tokener object \
    f43be0
    -* [Issue #285](https://github.com/json-c/json-c/issues/285) - Revert "compat/strdup.h: move common compat check for strdup() to own \
    f43be0
    -* [Issue #286](https://github.com/json-c/json-c/issues/286) - json_tokener_parse_ex() returns json_tokener_continue on zero-length string \
    f43be0
    -* [Issue #287](https://github.com/json-c/json-c/issues/287) - json_pointer: extend setter & getter with printf() style arguments \
    f43be0
    -* [Issue #288](https://github.com/json-c/json-c/issues/288) - Fix _GNU_SOURCE define for vasprintf \
    f43be0
    -* [Issue #289](https://github.com/json-c/json-c/issues/289) - bugfix: floating point representaion without fractional part \
    f43be0
    -* [Issue #290](https://github.com/json-c/json-c/issues/290) - duplicate an json_object \
    f43be0
    -* [Issue #291](https://github.com/json-c/json-c/issues/291) - isspace assert error \
    f43be0
    -* [Issue #292](https://github.com/json-c/json-c/issues/292) - configure error  "./configure: line 13121: syntax error near unexpected token `-Wall'" \
    f43be0
    -* [Issue #293](https://github.com/json-c/json-c/issues/293) - how to make with bitcode for ios \
    f43be0
    -* [Issue #294](https://github.com/json-c/json-c/issues/294) - Adding UTF-8 validation.  Fixes #122 \
    f43be0
    -* [Issue #295](https://github.com/json-c/json-c/issues/295) - cross compile w/ mingw \
    f43be0
    -* [Issue #296](https://github.com/json-c/json-c/issues/296) - Missing functions header in json_object.h \
    f43be0
    -* [Issue #297](https://github.com/json-c/json-c/issues/297) - could not parse string to Json object? Like string str=\"helloworld;E\\test\\log\\;end\" \
    f43be0
    -* [Issue #298](https://github.com/json-c/json-c/issues/298) - Building using CMake doesn't work \
    f43be0
    -* [Issue #299](https://github.com/json-c/json-c/issues/299) - Improve json_object -> string performance \
    f43be0
    -* [Issue #300](https://github.com/json-c/json-c/issues/300) - Running tests with MinGW build \
    f43be0
    -* [Issue #301](https://github.com/json-c/json-c/issues/301) - How to deep copy  json_object in C++ ? \
    f43be0
    -* [Issue #302](https://github.com/json-c/json-c/issues/302) - json_tokener_parse_ex doesn't parse JSON values \
    f43be0
    -* [Issue #303](https://github.com/json-c/json-c/issues/303) - fix doc in tokener header file \
    f43be0
    -* [Issue #304](https://github.com/json-c/json-c/issues/304) - (.text+0x72846): undefined reference to `is_error' \
    f43be0
    -* [Issue #305](https://github.com/json-c/json-c/issues/305) - Fix compilation without C-99 option \
    f43be0
    -* [Issue #306](https://github.com/json-c/json-c/issues/306) - ./configure: line 12748 -error=deprecated-declarations \
    f43be0
    -* [Issue #307](https://github.com/json-c/json-c/issues/307) - Memory leak in json_tokener_parse \
    f43be0
    -* [Issue #308](https://github.com/json-c/json-c/issues/308) - AM_PROG_LIBTOOL not found on Linux \
    f43be0
    -* [Issue #309](https://github.com/json-c/json-c/issues/309) - GCC 7 reports various -Wimplicit-fallthrough= errors \
    f43be0
    -* [Issue #310](https://github.com/json-c/json-c/issues/310) - Add FALLTHRU comment to handle GCC7 warnings. \
    f43be0
    -* [Issue #311](https://github.com/json-c/json-c/issues/311) - Fix error C3688 when compiling on Visual Studio 2015 \
    f43be0
    -* [Issue #312](https://github.com/json-c/json-c/issues/312) - Fix CMake Build process improved for MinGW and MSYS2 \
    f43be0
    -* [Issue #313](https://github.com/json-c/json-c/issues/313) - VERBOSE=1 make check; tests/test_util_file.test.c and tests/test_util_file.expected out of sync \
    f43be0
    -* [Issue #315](https://github.com/json-c/json-c/issues/315) - Passing -1 to json_tokener_parse_ex is possibly unsafe \
    f43be0
    -* [Issue #316](https://github.com/json-c/json-c/issues/316) - Memory Returned by json_object_to_json_string not freed \
    f43be0
    -* [Issue #317](https://github.com/json-c/json-c/issues/317) - json_object_get_string gives segmentation error \
    f43be0
    -* [Issue #318](https://github.com/json-c/json-c/issues/318) - PVS-Studio static analyzer analyze results \
    f43be0
    -* [Issue #319](https://github.com/json-c/json-c/issues/319) - Windows: Fix dynamic library build with Visual Studio \
    f43be0
    -* [Issue #320](https://github.com/json-c/json-c/issues/320) - Can't compile in Mac OS X El Capitan \
    f43be0
    -* [Issue #321](https://github.com/json-c/json-c/issues/321) - build,cmake: fix vasprintf implicit definition and generate both static & shared libs \
    f43be0
    -* [Issue #322](https://github.com/json-c/json-c/issues/322) - can not link with libjson-c.a \
    f43be0
    -* [Issue #323](https://github.com/json-c/json-c/issues/323) - implicit fallthrough detected by gcc 7.1 \
    f43be0
    -* [Issue #324](https://github.com/json-c/json-c/issues/324) - JsonPath like function? \
    f43be0
    -* [Issue #325](https://github.com/json-c/json-c/issues/325) - Fix stack buffer overflow in json_object_double_to_json_string_format() \
    f43be0
    -* [Issue #327](https://github.com/json-c/json-c/issues/327) - why json-c so hard to compile \
    f43be0
    -* [Issue #328](https://github.com/json-c/json-c/issues/328) - json_object: implement json_object_deep_copy() function \
    f43be0
    -* [Issue #329](https://github.com/json-c/json-c/issues/329) - build,cmake: build,cmake: rename libjson-c-static.a to libjson-c.a \
    f43be0
    -* [Issue #330](https://github.com/json-c/json-c/issues/330) - tests: symlink basic tests to a single file that has the common code \
    f43be0
    -* [Issue #331](https://github.com/json-c/json-c/issues/331) - Safe use of snprintf() / vsnprintf() for Visual studio, and thread-safety fix \
    f43be0
    -* [Issue #332](https://github.com/json-c/json-c/issues/332) - Valgrind: invalid read after json_object_array_del_idx. \
    f43be0
    -* [Issue #333](https://github.com/json-c/json-c/issues/333) - Replace obsolete AM_PROG_LIBTOOL \
    f43be0
    -* [Issue #335](https://github.com/json-c/json-c/issues/335) - README.md: show build status tag from travis-ci.org \
    f43be0
    -* [Issue #336](https://github.com/json-c/json-c/issues/336) - tests: fix tests in travis-ci.org \
    f43be0
    -* [Issue #337](https://github.com/json-c/json-c/issues/337) - Synchronize "potentially racy" random seed in lh_char_hash() \
    f43be0
    -* [Issue #338](https://github.com/json-c/json-c/issues/338) - implement json_object_int_inc(json_object *, int64_t) \
    f43be0
    -* [Issue #339](https://github.com/json-c/json-c/issues/339) - Json schema validation \
    f43be0
    -* [Issue #340](https://github.com/json-c/json-c/issues/340) - strerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers \
    f43be0
    -* [Issue #341](https://github.com/json-c/json-c/issues/341) - character "/" parse as "\/" \
    f43be0
    -* [Issue #342](https://github.com/json-c/json-c/issues/342) - No such file or directory "/usr/include/json.h" \
    f43be0
    -* [Issue #343](https://github.com/json-c/json-c/issues/343) - Can't parse json \
    f43be0
    -* [Issue #344](https://github.com/json-c/json-c/issues/344) - Fix Mingw build \
    f43be0
    -* [Issue #345](https://github.com/json-c/json-c/issues/345) - Fix make dist and make distcheck \
    f43be0
    -* [Issue #346](https://github.com/json-c/json-c/issues/346) - Clamp double to int32 when narrowing in json_object_get_int. \
    f43be0
    -* [Issue #347](https://github.com/json-c/json-c/issues/347) - MSVC linker error json_c_strerror \
    f43be0
    -* [Issue #348](https://github.com/json-c/json-c/issues/348) - why \
    f43be0
    -* [Issue #349](https://github.com/json-c/json-c/issues/349) - `missing` is missing? \
    f43be0
    -* [Issue #350](https://github.com/json-c/json-c/issues/350) - stderror-override and disable-shared \
    f43be0
    -* [Issue #351](https://github.com/json-c/json-c/issues/351) - SIZE_T_MAX redefined from limits.h \
    f43be0
    -* [Issue #352](https://github.com/json-c/json-c/issues/352) - `INSTALL` overrides an automake script. \
    f43be0
    -* [Issue #353](https://github.com/json-c/json-c/issues/353) - Documentation issues \
    f43be0
    -* [Issue #354](https://github.com/json-c/json-c/issues/354) - Fixes #351 #352 #353 \
    f43be0
    -* [Issue #355](https://github.com/json-c/json-c/issues/355) - 1.make it can been compiled with Visual Studio 2010 by modify the CMakeList.txt and others \
    f43be0
    -* [Issue #356](https://github.com/json-c/json-c/issues/356) - VS2008 test  test_util_file.cpp err! \
    f43be0
    -* [Issue #357](https://github.com/json-c/json-c/issues/357) - __json_c_strerror incompatibility with link-time optimization \
    f43be0
    -* [Issue #358](https://github.com/json-c/json-c/issues/358) - make issue \
    f43be0
    -* [Issue #359](https://github.com/json-c/json-c/issues/359) - update CMakeLists.txt for compile with visual studio at least 2010 \
    f43be0
    -* [Issue #360](https://github.com/json-c/json-c/issues/360) - Use strtoll() to parse ints \
    f43be0
    -* [Issue #361](https://github.com/json-c/json-c/issues/361) - Fix double to int cast overflow in json_object_get_int64. \
    f43be0
    -* [Issue #362](https://github.com/json-c/json-c/issues/362) - CMake Package Config \
    f43be0
    -* [Issue #363](https://github.com/json-c/json-c/issues/363) - Issue #338, add json_object_add_int functions \
    f43be0
    -* [Issue #364](https://github.com/json-c/json-c/issues/364) - Cmake is Errir \
    f43be0
    -* [Issue #365](https://github.com/json-c/json-c/issues/365) - added fallthrough for gcc7 \
    f43be0
    -* [Issue #366](https://github.com/json-c/json-c/issues/366) - how to check  the json string,crash! \
    f43be0
    -* [Issue #367](https://github.com/json-c/json-c/issues/367) - Is json-c support "redirect" semantic? \
    f43be0
    -* [Issue #368](https://github.com/json-c/json-c/issues/368) - Add examples \
    f43be0
    -* [Issue #369](https://github.com/json-c/json-c/issues/369) - How to build json-c library for android? \
    f43be0
    -* [Issue #370](https://github.com/json-c/json-c/issues/370) - Compiling using clang-cl \
    f43be0
    -* [Issue #371](https://github.com/json-c/json-c/issues/371) - Invalid parsing for Infinity with json-c 0.12 \
    f43be0
    -* [Issue #372](https://github.com/json-c/json-c/issues/372) - Json-c 0.12: Fixed Infinity bug \
    f43be0
    -* [Issue #373](https://github.com/json-c/json-c/issues/373) - build: fix build on appveyor CI \
    f43be0
    -* [Issue #374](https://github.com/json-c/json-c/issues/374) - Undefined symbols for architecture x86_64: \
    f43be0
    -* [Issue #375](https://github.com/json-c/json-c/issues/375) - what would happened when json_object_object_add add the same key \
    f43be0
    -* [Issue #376](https://github.com/json-c/json-c/issues/376) - Eclipse error \
    f43be0
    -* [Issue #377](https://github.com/json-c/json-c/issues/377) - on gcc 7.2.0 on my linux distribution with json-c  2013-04-02 source \
    f43be0
    -* [Issue #378](https://github.com/json-c/json-c/issues/378) - Eclipse: library (libjson-c) not found, but configured \
    f43be0
    -* [Issue #379](https://github.com/json-c/json-c/issues/379) - error: this statement may fall through \[-Werror=implicit-fallthrough=\] \
    f43be0
    -* [Issue #380](https://github.com/json-c/json-c/issues/380) - Build on Windows \
    f43be0
    -* [Issue #381](https://github.com/json-c/json-c/issues/381) - Fix makedist \
    f43be0
    -* [Issue #382](https://github.com/json-c/json-c/issues/382) - Memory leak for json_tokener_parse_ex for version 0.12.1 \
    f43be0
    -* [Issue #383](https://github.com/json-c/json-c/issues/383) - Fix a compiler warning. \
    f43be0
    -* [Issue #384](https://github.com/json-c/json-c/issues/384) - Fix a VS 2015 compiler warnings. \
    f43be0
    diff --git a/comm/third_party/json-c/issues_closed_for_0.14.md b/comm/third_party/json-c/issues_closed_for_0.14.md
    f43be0
    deleted file mode 100644
    f43be0
    --- a/comm/third_party/json-c/issues_closed_for_0.14.md
    f43be0
    +++ /dev/null
    f43be0
    @@ -1,202 +0,0 @@
    f43be0
    -This list was created with:
    f43be0
    -
    f43be0
    -```
    f43be0
    -curl https://api.github.com/search/issues?q="repo%3Ajson-c%2Fjson-c+closed%3A>2017-12-07+created%3A<2020-04-17&sort=created&order=asc&per_page=400&page=1" > issues1.out
    f43be0
    -curl https://api.github.com/search/issues?q="repo%3Ajson-c%2Fjson-c+closed%3A>2017-12-07+created%3A<2020-04-17&sort=created&order=asc&per_page=400&page=2" > issues2.out
    f43be0
    -curl https://api.github.com/search/issues?q="repo%3Ajson-c%2Fjson-c+closed%3A>2017-12-07+created%3A<2020-04-17&sort=created&order=asc&per_page=400&page=3" > issues3.out
    f43be0
    -jq -r '.items[] | "[" + .title + "](" + .url + ")" | tostring' issues?.out > issues.md
    f43be0
    -sed -e's,^\[ *\(.*\)\](https://api.github.com/.*/\([0-9].*\)),[Issue #\2](https://github.com/json-c/json-c/issues/\2) - \1,' -i issues.md
    f43be0
    -#... manual editing ...
    f43be0
    -```
    f43be0
    -
    f43be0
    -----
    f43be0
    -
    f43be0
    -Issues and Pull Requests closed for the 0.14 release (since commit d582d3a(2017-12-07) to a911439(2020-04-17))
    f43be0
    -
    f43be0
    -
    f43be0
    -* [Issue #122](https://github.com/json-c/json-c/issues/122) - Add utf-8 validation when parsing strings. \
    f43be0
    -* [Issue #139](https://github.com/json-c/json-c/issues/139) - json_object_from_file cannot accept max_depth \
    f43be0
    -* [Issue #143](https://github.com/json-c/json-c/issues/143) - RFE / enhancement for full 64-bit signed/unsigned support \
    f43be0
    -* [Issue #147](https://github.com/json-c/json-c/issues/147) - Please introduce soname bump if API changed \
    f43be0
    -* [Issue #166](https://github.com/json-c/json-c/issues/166) - Need a way to specify nesting depth when opening JSON file \
    f43be0
    -* [Issue #226](https://github.com/json-c/json-c/issues/226) - There is no json_object_new_null() \
    f43be0
    -* [Issue #314](https://github.com/json-c/json-c/issues/314) - new release ? \
    f43be0
    -* [Issue #326](https://github.com/json-c/json-c/issues/326) - Please extend api json_object_get_uint64 \
    f43be0
    -* [Issue #334](https://github.com/json-c/json-c/issues/334) - Switch json-c builds to use CMake \
    f43be0
    -* [Issue #386](https://github.com/json-c/json-c/issues/386) - Makefile: Add ACLOCAL_AMFLAGS \
    f43be0
    -* [Issue #387](https://github.com/json-c/json-c/issues/387) - doc: Use other doxygen feature to specify mainpage \
    f43be0
    -* [Issue #388](https://github.com/json-c/json-c/issues/388) - json_object: Add size_t json_object_sizeof() \
    f43be0
    -* [Issue #389](https://github.com/json-c/json-c/issues/389) - json_object: Avoid double free (and thus a segfault) when ref_count gets < 0 \
    f43be0
    -* [Issue #390](https://github.com/json-c/json-c/issues/390) - json_object: Add const size_t json_c_object_sizeof() \
    f43be0
    -* [Issue #391](https://github.com/json-c/json-c/issues/391) - Fix non-GNUC define for JSON_C_CONST_FUNCTION \
    f43be0
    -* [Issue #392](https://github.com/json-c/json-c/issues/392) - json_object: Avoid invalid free (and thus a segfault) when ref_count gets < 0 \
    f43be0
    -* [Issue #393](https://github.com/json-c/json-c/issues/393) - json_object_private: Use unsigned 32-bit integer type for refcount \
    f43be0
    -* [Issue #394](https://github.com/json-c/json-c/issues/394) - Problem serializing double \
    f43be0
    -* [Issue #395](https://github.com/json-c/json-c/issues/395) - Key gets modified if it contains "\" \
    f43be0
    -* [Issue #396](https://github.com/json-c/json-c/issues/396) - Build failure with no threads uClibc toolchain \
    f43be0
    -* [Issue #397](https://github.com/json-c/json-c/issues/397) - update json object with key. \
    f43be0
    -* [Issue #398](https://github.com/json-c/json-c/issues/398) - Build failed. \
    f43be0
    -* [Issue #399](https://github.com/json-c/json-c/issues/399) - Avoid uninitialized variable warnings \
    f43be0
    -* [Issue #400](https://github.com/json-c/json-c/issues/400) - How to generate static lib (.a) \
    f43be0
    -* [Issue #401](https://github.com/json-c/json-c/issues/401) - Warnings with Valgrind \
    f43be0
    -* [Issue #402](https://github.com/json-c/json-c/issues/402) - Add fuzzers from OSS-Fuzz \
    f43be0
    -* [Issue #403](https://github.com/json-c/json-c/issues/403) - Segmentation fault when double quotes is used \
    f43be0
    -* [Issue #404](https://github.com/json-c/json-c/issues/404) - valgrind: memory leak \
    f43be0
    -* [Issue #405](https://github.com/json-c/json-c/issues/405) - Missing API to determine an object is empty \
    f43be0
    -* [Issue #406](https://github.com/json-c/json-c/issues/406) - Undefine NDEBUG for tests \
    f43be0
    -* [Issue #407](https://github.com/json-c/json-c/issues/407) - json_tokener_parse is crash \
    f43be0
    -* [Issue #408](https://github.com/json-c/json-c/issues/408) - bug in array_list_del_idx when array_list_length()==1 \
    f43be0
    -* [Issue #410](https://github.com/json-c/json-c/issues/410) - Fixed typos \
    f43be0
    -* [Issue #411](https://github.com/json-c/json-c/issues/411) - Crash- signal SIGSEGV, Segmentation fault. ../sysdeps/x86_64/strlen.S: No such file or directory. \
    f43be0
    -* [Issue #412](https://github.com/json-c/json-c/issues/412) - json_type changes during inter process communication. \
    f43be0
    -* [Issue #413](https://github.com/json-c/json-c/issues/413) - how to read object of type `json_object *` in c++ \
    f43be0
    -* [Issue #414](https://github.com/json-c/json-c/issues/414) - [Question] How JSON-c stores the serialized data in memory? \
    f43be0
    -* [Issue #415](https://github.com/json-c/json-c/issues/415) - Resolve windows name conflict \
    f43be0
    -* [Issue #416](https://github.com/json-c/json-c/issues/416) - segmentation fault  in json_tokener_parse \
    f43be0
    -* [Issue #417](https://github.com/json-c/json-c/issues/417) - json_tokener_parse  json_object_object_get_ex with string value which is json string \
    f43be0
    -* [Issue #418](https://github.com/json-c/json-c/issues/418) - json_object_from_* return value documented incorrectly \
    f43be0
    -* [Issue #419](https://github.com/json-c/json-c/issues/419) - Suggestion: document (and define) that json_object_put() accepts NULL pointer to object \
    f43be0
    -* [Issue #420](https://github.com/json-c/json-c/issues/420) - arraylist: Fixed names of parameters for callback function \
    f43be0
    -* [Issue #421](https://github.com/json-c/json-c/issues/421) - install json_object_iterator.h header file \
    f43be0
    -* [Issue #422](https://github.com/json-c/json-c/issues/422) - json_object_get_double() does not set errno when there is no valid conversion \
    f43be0
    -* [Issue #423](https://github.com/json-c/json-c/issues/423) - memory leak \
    f43be0
    -* [Issue #424](https://github.com/json-c/json-c/issues/424) - Parse string contains "\" or "/" errors \
    f43be0
    -* [Issue #425](https://github.com/json-c/json-c/issues/425) - what this is? \
    f43be0
    -* [Issue #426](https://github.com/json-c/json-c/issues/426) - __deprecated not supported on clang. \
    f43be0
    -* [Issue #427](https://github.com/json-c/json-c/issues/427) - CMake: builds involving this target will not be correct \
    f43be0
    -* [Issue #430](https://github.com/json-c/json-c/issues/430) - json_object_object_del() and Segmentation fault \
    f43be0
    -* [Issue #431](https://github.com/json-c/json-c/issues/431) - cmake: Bump required version \
    f43be0
    -* [Issue #432](https://github.com/json-c/json-c/issues/432) - The real CMake support. \
    f43be0
    -* [Issue #433](https://github.com/json-c/json-c/issues/433) - The real CMake support. \
    f43be0
    -* [Issue #434](https://github.com/json-c/json-c/issues/434) - The real CMake support \
    f43be0
    -* [Issue #435](https://github.com/json-c/json-c/issues/435) - json_object_object_del() segmentation fault \
    f43be0
    -* [Issue #436](https://github.com/json-c/json-c/issues/436) - Improve pkgconfig setting \
    f43be0
    -* [Issue #437](https://github.com/json-c/json-c/issues/437) - Bad link in README.md \
    f43be0
    -* [Issue #438](https://github.com/json-c/json-c/issues/438) - Bad link in README.html \
    f43be0
    -* [Issue #439](https://github.com/json-c/json-c/issues/439) - reserved identifier violation \
    f43be0
    -* [Issue #440](https://github.com/json-c/json-c/issues/440) - Use of angle brackets around file names for include statements \
    f43be0
    -* [Issue #441](https://github.com/json-c/json-c/issues/441) - fix c flag loss during cmake building \
    f43be0
    -* [Issue #442](https://github.com/json-c/json-c/issues/442) - error  in configure file \
    f43be0
    -* [Issue #443](https://github.com/json-c/json-c/issues/443) - remove pretty spaces when using pretty tabs \
    f43be0
    -* [Issue #444](https://github.com/json-c/json-c/issues/444) - Document refcount of json_tokener_parse_ex return \
    f43be0
    -* [Issue #445](https://github.com/json-c/json-c/issues/445) - Add missing "make check" target to cmake config \
    f43be0
    -* [Issue #446](https://github.com/json-c/json-c/issues/446) - Forward slashes get escaped \
    f43be0
    -* [Issue #448](https://github.com/json-c/json-c/issues/448) - Buffer overflow in json-c \
    f43be0
    -* [Issue #449](https://github.com/json-c/json-c/issues/449) - Need of json_type_int64 returned by json_object_get_type() \
    f43be0
    -* [Issue #450](https://github.com/json-c/json-c/issues/450) - Allow use json-c cmake as subproject \
    f43be0
    -* [Issue #452](https://github.com/json-c/json-c/issues/452) - Update README.md \
    f43be0
    -* [Issue #453](https://github.com/json-c/json-c/issues/453) - Fixed misalignment in JSON string due to space after \n being printed... \
    f43be0
    -* [Issue #454](https://github.com/json-c/json-c/issues/454) - json_object_private: save 8 bytes in struct json_object in 64-bit arc… \
    f43be0
    -* [Issue #455](https://github.com/json-c/json-c/issues/455) - index.html:fix dead link \
    f43be0
    -* [Issue #456](https://github.com/json-c/json-c/issues/456) - STYLE.txt:remove executable permissions \
    f43be0
    -* [Issue #457](https://github.com/json-c/json-c/issues/457) - .gitignore:add build directory \
    f43be0
    -* [Issue #458](https://github.com/json-c/json-c/issues/458) - README.md:fix dead "file.html" link \
    f43be0
    -* [Issue #459](https://github.com/json-c/json-c/issues/459) - README.html:fix link to Doxygen docs, remove WIN32 link \
    f43be0
    -* [Issue #460](https://github.com/json-c/json-c/issues/460) - No docs for json_object_new_string_len() \
    f43be0
    -* [Issue #461](https://github.com/json-c/json-c/issues/461) - json_object.c:set errno in json_object_get_double() \
    f43be0
    -* [Issue #462](https://github.com/json-c/json-c/issues/462) - json_object.h:document json_object_new_string_len() \
    f43be0
    -* [Issue #463](https://github.com/json-c/json-c/issues/463) - please check newlocale api first argument valuse. \
    f43be0
    -* [Issue #465](https://github.com/json-c/json-c/issues/465) - CMakeLists.txt doesn't contain json_object_iterator.h which json.h includes \
    f43be0
    -* [Issue #466](https://github.com/json-c/json-c/issues/466) - configure:3610: error: C compiler cannot create executables \
    f43be0
    -* [Issue #467](https://github.com/json-c/json-c/issues/467) - Fix compiler warnings \
    f43be0
    -* [Issue #468](https://github.com/json-c/json-c/issues/468) - Fix compiler warnings \
    f43be0
    -* [Issue #469](https://github.com/json-c/json-c/issues/469) - Build under alpine with pecl install & docker-php-ext-enable? \
    f43be0
    -* [Issue #470](https://github.com/json-c/json-c/issues/470) - cfuhash_foreach_remove doesn't upate cfuhash_num_entries \
    f43be0
    -* [Issue #472](https://github.com/json-c/json-c/issues/472) - Segmentation fault in json_object_iter_begin \
    f43be0
    -* [Issue #473](https://github.com/json-c/json-c/issues/473) - Convert ChangeLog to valid UTF-8 encoding. \
    f43be0
    -* [Issue #474](https://github.com/json-c/json-c/issues/474) - Installation directories empty with CMake in pkg-config. \
    f43be0
    -* [Issue #475](https://github.com/json-c/json-c/issues/475) - improvement proposal for json_object_object_foreach \
    f43be0
    -* [Issue #477](https://github.com/json-c/json-c/issues/477) - Hang/Crash with large strings \
    f43be0
    -* [Issue #478](https://github.com/json-c/json-c/issues/478) - json_object_get_string_len returns 0 when value is number \
    f43be0
    -* [Issue #479](https://github.com/json-c/json-c/issues/479) - I want to use it in iOS or Android but I can't compile \
    f43be0
    -* [Issue #480](https://github.com/json-c/json-c/issues/480) - json-c-0.12.1  failed making from source code \
    f43be0
    -* [Issue #481](https://github.com/json-c/json-c/issues/481) - error while loading shared libraries: libjson-c.so.4 \
    f43be0
    -* [Issue #482](https://github.com/json-c/json-c/issues/482) - Error "double free or corruption" after free() \
    f43be0
    -* [Issue #483](https://github.com/json-c/json-c/issues/483) - compatible with rarely-used Chinese characters in GBK charset \
    f43be0
    -* [Issue #485](https://github.com/json-c/json-c/issues/485) - Install CMake module files \
    f43be0
    -* [Issue #486](https://github.com/json-c/json-c/issues/486) - In the case of negative double value, it is formatted without including ".0" \
    f43be0
    -* [Issue #488](https://github.com/json-c/json-c/issues/488) - Some APIs are not exported when built as shared lib on Win32 \
    f43be0
    -* [Issue #489](https://github.com/json-c/json-c/issues/489) - Don't use -Werror by default \
    f43be0
    -* [Issue #490](https://github.com/json-c/json-c/issues/490) - do not compile with -Werror by default \
    f43be0
    -* [Issue #491](https://github.com/json-c/json-c/issues/491) - build: add option --disable-werror to configure \
    f43be0
    -* [Issue #492](https://github.com/json-c/json-c/issues/492) - lack some quick usage in readme \
    f43be0
    -* [Issue #494](https://github.com/json-c/json-c/issues/494) - Code generator? \
    f43be0
    -* [Issue #495](https://github.com/json-c/json-c/issues/495) - README.md:fix 2 typos \
    f43be0
    -* [Issue #496](https://github.com/json-c/json-c/issues/496) - json_pointer.h:suggest minor grammar improvement for pointer doc \
    f43be0
    -* [Issue #497](https://github.com/json-c/json-c/issues/497) - add common header for all tests \
    f43be0
    -* [Issue #498](https://github.com/json-c/json-c/issues/498) - double_serializer_test fails (with valgrind) \
    f43be0
    -* [Issue #499](https://github.com/json-c/json-c/issues/499) - .travis.yml:test on more recent clang and gcc versions \
    f43be0
    -* [Issue #500](https://github.com/json-c/json-c/issues/500) - test/Makefile.am:add missing deps for test1 and test2 \
    f43be0
    -* [Issue #501](https://github.com/json-c/json-c/issues/501) - undefine NDEBUG for tests \
    f43be0
    -* [Issue #502](https://github.com/json-c/json-c/issues/502) - configure error \
    f43be0
    -* [Issue #503](https://github.com/json-c/json-c/issues/503) - json-c retuns OK when Invalid json string is passed \
    f43be0
    -* [Issue #504](https://github.com/json-c/json-c/issues/504) - json_object_put coredump \
    f43be0
    -* [Issue #505](https://github.com/json-c/json-c/issues/505) - Add vcpkg installation instructions \
    f43be0
    -* [Issue #506](https://github.com/json-c/json-c/issues/506) - Cannot parse more than one object \
    f43be0
    -* [Issue #509](https://github.com/json-c/json-c/issues/509) - Sometimes a double value is not serialized \
    f43be0
    -* [Issue #510](https://github.com/json-c/json-c/issues/510) - Bump so-name and improve CMake \
    f43be0
    -* [Issue #511](https://github.com/json-c/json-c/issues/511) - Reduce lines for better optimization \
    f43be0
    -* [Issue #512](https://github.com/json-c/json-c/issues/512) - Properly append to CMAKE_C_FLAGS string \
    f43be0
    -* [Issue #513](https://github.com/json-c/json-c/issues/513) - What does `userdata` means?And what is the case we can use it? \
    f43be0
    -* [Issue #514](https://github.com/json-c/json-c/issues/514) - Json c 0.13 \
    f43be0
    -* [Issue #515](https://github.com/json-c/json-c/issues/515) - Mies suomesta fixes segfaults and logic errors \
    f43be0
    -* [Issue #516](https://github.com/json-c/json-c/issues/516) - Lja slight mods \
    f43be0
    -* [Issue #518](https://github.com/json-c/json-c/issues/518) - Escape character  "\\003\", get unexpected value \
    f43be0
    -* [Issue #519](https://github.com/json-c/json-c/issues/519) - Add test case obj token \
    f43be0
    -* [Issue #520](https://github.com/json-c/json-c/issues/520) - Adding type uint64 \
    f43be0
    -* [Issue #521](https://github.com/json-c/json-c/issues/521) - build cmake windows 10 \
    f43be0
    -* [Issue #522](https://github.com/json-c/json-c/issues/522) - update json_visit testcase \
    f43be0
    -* [Issue #523](https://github.com/json-c/json-c/issues/523) - update tsetcase for tokener_c \
    f43be0
    -* [Issue #524](https://github.com/json-c/json-c/issues/524) - Increase coverage \
    f43be0
    -* [Issue #525](https://github.com/json-c/json-c/issues/525) - update pointer test case \
    f43be0
    -* [Issue #526](https://github.com/json-c/json-c/issues/526) - Increased the test coverage of printbuf.c 82% to 92%. \
    f43be0
    -* [Issue #527](https://github.com/json-c/json-c/issues/527) - Arraylist testcase \
    f43be0
    -* [Issue #528](https://github.com/json-c/json-c/issues/528) - Solve issue #108. Skip \u0000 while parsing. \
    f43be0
    -* [Issue #529](https://github.com/json-c/json-c/issues/529) - Increased the test coverage of json_c_version.c 0% to 100%. \
    f43be0
    -* [Issue #530](https://github.com/json-c/json-c/issues/530) - validate utf-8 string before parse \
    f43be0
    -* [Issue #531](https://github.com/json-c/json-c/issues/531) - validate utf-8 string \
    f43be0
    -* [Issue #532](https://github.com/json-c/json-c/issues/532) - json_object_object_get_ex returning the original object \
    f43be0
    -* [Issue #533](https://github.com/json-c/json-c/issues/533) - Fix "make check" \
    f43be0
    -* [Issue #535](https://github.com/json-c/json-c/issues/535) - short string optimization: excessive array length \
    f43be0
    -* [Issue #536](https://github.com/json-c/json-c/issues/536) - add json_object_new_null() \
    f43be0
    -* [Issue #538](https://github.com/json-c/json-c/issues/538) - update shortstring and arraylist parameters \
    f43be0
    -* [Issue #539](https://github.com/json-c/json-c/issues/539) - double serializes to the old value after set_double \
    f43be0
    -* [Issue #541](https://github.com/json-c/json-c/issues/541) - add coveralls auto tool to json-c \
    f43be0
    -* [Issue #542](https://github.com/json-c/json-c/issues/542) - add uint64 data to json-c \
    f43be0
    -* [Issue #543](https://github.com/json-c/json-c/issues/543) - Readme \
    f43be0
    -* [Issue #544](https://github.com/json-c/json-c/issues/544) - Increase distcheck target in cmake \
    f43be0
    -* [Issue #545](https://github.com/json-c/json-c/issues/545) - add doc target in cmake \
    f43be0
    -* [Issue #546](https://github.com/json-c/json-c/issues/546) - Add uninstall target in cmake \
    f43be0
    -* [Issue #547](https://github.com/json-c/json-c/issues/547) - modify json-c default build type, and fix up the assert() errors in t… \
    f43be0
    -* [Issue #548](https://github.com/json-c/json-c/issues/548) - Solve some problems about cmake build type (debug/release) \
    f43be0
    -* [Issue #549](https://github.com/json-c/json-c/issues/549) - lib installation issues \
    f43be0
    -* [Issue #550](https://github.com/json-c/json-c/issues/550) - Format codes with clang-format tool? \
    f43be0
    -* [Issue #551](https://github.com/json-c/json-c/issues/551) - Allow hexadecimal number format convention parsing \
    f43be0
    -* [Issue #553](https://github.com/json-c/json-c/issues/553) - Fix/clang ubsan \
    f43be0
    -* [Issue #554](https://github.com/json-c/json-c/issues/554) - RFC 8259 compatibility mode \
    f43be0
    -* [Issue #555](https://github.com/json-c/json-c/issues/555) - Format json-c with clang-format tool \
    f43be0
    -* [Issue #556](https://github.com/json-c/json-c/issues/556) - Fixes various Wreturn-type and Wimplicit-fallthrough errors on Mingw-w64 \
    f43be0
    -* [Issue #557](https://github.com/json-c/json-c/issues/557) - Add option in CMAKE to not build documentation \
    f43be0
    -* [Issue #558](https://github.com/json-c/json-c/issues/558) - modify the doc target message \
    f43be0
    -* [Issue #559](https://github.com/json-c/json-c/issues/559) - json_c_visit() not exported on Windows \
    f43be0
    -* [Issue #560](https://github.com/json-c/json-c/issues/560) - error: implicit declaration of function '_strtoi64' \
    f43be0
    -* [Issue #561](https://github.com/json-c/json-c/issues/561) - add the badge in README.md and test the coveralls \
    f43be0
    -* [Issue #562](https://github.com/json-c/json-c/issues/562) - Bugfix and testcases supplements \
    f43be0
    -* [Issue #563](https://github.com/json-c/json-c/issues/563) - Changed order of calloc args to match stdlib \
    f43be0
    -* [Issue #564](https://github.com/json-c/json-c/issues/564) - Remove autogenerated files \
    f43be0
    -* [Issue #565](https://github.com/json-c/json-c/issues/565) - test the CI and ignore this PR \
    f43be0
    -* [Issue #566](https://github.com/json-c/json-c/issues/566) - add the json_types.h to Makefile.am \
    f43be0
    -* [Issue #567](https://github.com/json-c/json-c/issues/567) - Install json_types.h with autotools build as well. \
    f43be0
    -* [Issue #568](https://github.com/json-c/json-c/issues/568) - Adding better support to MinGW \
    f43be0
    -* [Issue #569](https://github.com/json-c/json-c/issues/569) - Handling of -Bsymbolic-function in CMakeLists.txt is deficient \
    f43be0
    -* [Issue #571](https://github.com/json-c/json-c/issues/571) - CMake: Bump SONAME to 5. \
    f43be0
    -* [Issue #572](https://github.com/json-c/json-c/issues/572) - Small fixes to CMakeLists \
    f43be0
    -* [Issue #573](https://github.com/json-c/json-c/issues/573) - Fix coveralls submission. \
    f43be0
    -* [Issue #574](https://github.com/json-c/json-c/issues/574) - autogen.sh missing from repository \
    f43be0
    -* [Issue #575](https://github.com/json-c/json-c/issues/575) - Small cosmetics. \
    f43be0
    -* [Issue #576](https://github.com/json-c/json-c/issues/576) - Test coverage for json_c_version. \
    f43be0
    -* [Issue #577](https://github.com/json-c/json-c/issues/577) - Be verbose on failing json_c_version test. \
    f43be0
    -* [Issue #578](https://github.com/json-c/json-c/issues/578) - CMake: Install pkgconfig file in proper location by default \
    f43be0
    -* [Issue #579](https://github.com/json-c/json-c/issues/579) - Enforce strict prototypes. \
    f43be0
    -* [Issue #580](https://github.com/json-c/json-c/issues/580) - Fix CMake tests for enforced strict prototypes. \
    f43be0
    -* [Issue #581](https://github.com/json-c/json-c/issues/581) - CMakeLists: do not enforce strict prototypes on Windows. \
    f43be0
    diff --git a/comm/third_party/json-c/json.h b/comm/third_party/json-c/json.h
    f43be0
    deleted file mode 100644
    f43be0
    --- a/comm/third_party/json-c/json.h
    f43be0
    +++ /dev/null
    f43be0
    @@ -1,38 +0,0 @@
    f43be0
    -/*
    f43be0
    - * $Id: json.h,v 1.6 2006/01/26 02:16:28 mclark Exp $
    f43be0
    - *
    f43be0
    - * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
    f43be0
    - * Michael Clark <michael@metaparadigm.com>
    f43be0
    - * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
    f43be0
    - *
    f43be0
    - * This library is free software; you can redistribute it and/or modify
    f43be0
    - * it under the terms of the MIT license. See COPYING for details.
    f43be0
    - *
    f43be0
    - */
    f43be0
    -
    f43be0
    -/**
    f43be0
    - * @file
    f43be0
    - * @brief A convenience header that may be included instead of other individual ones.
    f43be0
    - */
    f43be0
    -#ifndef _json_h_
    f43be0
    -#define _json_h_
    f43be0
    -
    f43be0
    -#ifdef __cplusplus
    f43be0
    -extern "C" {
    f43be0
    -#endif
    f43be0
    -
    f43be0
    -#include "arraylist.h"
    f43be0
    -#include "debug.h"
    f43be0
    -#include "json_c_version.h"
    f43be0
    -#include "json_object.h"
    f43be0
    -#include "json_object_iterator.h"
    f43be0
    -#include "json_pointer.h"
    f43be0
    -#include "json_tokener.h"
    f43be0
    -#include "json_util.h"
    f43be0
    -#include "linkhash.h"
    f43be0
    -
    f43be0
    -#ifdef __cplusplus
    f43be0
    -}
    f43be0
    -#endif
    f43be0
    -
    f43be0
    -#endif
    f43be0
    diff --git a/comm/third_party/json-c/json.h.cmakein b/comm/third_party/json-c/json.h.cmakein
    f43be0
    new file mode 100644
    f43be0
    --- /dev/null
    f43be0
    +++ b/comm/third_party/json-c/json.h.cmakein
    f43be0
    @@ -0,0 +1,38 @@
    f43be0
    +/*
    f43be0
    + * $Id: json.h,v 1.6 2006/01/26 02:16:28 mclark Exp $
    f43be0
    + *
    f43be0
    + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
    f43be0
    + * Michael Clark <michael@metaparadigm.com>
    f43be0
    + * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
    f43be0
    + *
    f43be0
    + * This library is free software; you can redistribute it and/or modify
    f43be0
    + * it under the terms of the MIT license. See COPYING for details.
    f43be0
    + *
    f43be0
    + */
    f43be0
    +
    f43be0
    +/**
    f43be0
    + * @file
    f43be0
    + * @brief A convenience header that may be included instead of other individual ones.
    f43be0
    + */
    f43be0
    +#ifndef _json_h_
    f43be0
    +#define _json_h_
    f43be0
    +
    f43be0
    +#ifdef __cplusplus
    f43be0
    +extern "C" {
    f43be0
    +#endif
    f43be0
    +
    f43be0
    +#include "arraylist.h"
    f43be0
    +#include "debug.h"
    f43be0
    +#include "json_c_version.h"
    f43be0
    +#include "json_object.h"
    f43be0
    +#include "json_object_iterator.h"
    f43be0
    +@JSON_H_JSON_POINTER@
    f43be0
    +#include "json_tokener.h"
    f43be0
    +#include "json_util.h"
    f43be0
    +#include "linkhash.h"
    f43be0
    +
    f43be0
    +#ifdef __cplusplus
    f43be0
    +}
    f43be0
    +#endif
    f43be0
    +
    f43be0
    +#endif
    f43be0
    diff --git a/comm/third_party/json-c/json_c_version.h b/comm/third_party/json-c/json_c_version.h
    f43be0
    --- a/comm/third_party/json-c/json_c_version.h
    f43be0
    +++ b/comm/third_party/json-c/json_c_version.h
    f43be0
    @@ -1,7 +1,7 @@
    f43be0
     /*
    f43be0
    - * Copyright (c) 2012,2017,2019,2020 Eric Hawicz
    f43be0
    + * Copyright (c) 2012,2017-2022 Eric Haszlakiewicz
    f43be0
      *
    f43be0
      * This library is free software; you can redistribute it and/or modify
    f43be0
      * it under the terms of the MIT license. See COPYING for details.
    f43be0
      */
    f43be0
     
    f43be0
    @@ -15,18 +15,18 @@
    f43be0
     #ifdef __cplusplus
    f43be0
     extern "C" {
    f43be0
     #endif
    f43be0
     
    f43be0
     #define JSON_C_MAJOR_VERSION 0
    f43be0
    -#define JSON_C_MINOR_VERSION 15
    f43be0
    +#define JSON_C_MINOR_VERSION 16
    f43be0
     #define JSON_C_MICRO_VERSION 0
    f43be0
     #define JSON_C_VERSION_NUM \
    f43be0
     	((JSON_C_MAJOR_VERSION << 16) | (JSON_C_MINOR_VERSION << 8) | JSON_C_MICRO_VERSION)
    f43be0
    -#define JSON_C_VERSION "0.15"
    f43be0
    +#define JSON_C_VERSION "0.16"
    f43be0
     
    f43be0
     #ifndef JSON_EXPORT
    f43be0
    -#if defined(_MSC_VER)
    f43be0
    +#if defined(_MSC_VER) && defined(JSON_C_DLL)
    f43be0
     #define JSON_EXPORT __declspec(dllexport)
    f43be0
     #else
    f43be0
     #define JSON_EXPORT extern
    f43be0
     #endif
    f43be0
     #endif
    f43be0
    diff --git a/comm/third_party/json-c/json_config.h.win32 b/comm/third_party/json-c/json_config.h.win32
    f43be0
    deleted file mode 100644
    f43be0
    --- a/comm/third_party/json-c/json_config.h.win32
    f43be0
    +++ /dev/null
    f43be0
    @@ -1,5 +0,0 @@
    f43be0
    -
    f43be0
    -/* Define to 1 if you have the <inttypes.h> header file. */
    f43be0
    -#if defined(_MSC_VER) && _MSC_VER >= 1800
    f43be0
    -#define JSON_C_HAVE_INTTYPES_H 1
    f43be0
    -#endif
    f43be0
    diff --git a/comm/third_party/json-c/json_object.c b/third_party/json-c/json_ob/commject.c
    f43be0
    --- a/comm/third_party/json-c/json_object.c
    f43be0
    +++ b/comm/third_party/json-c/json_object.c
    f43be0
    @@ -11,11 +11,10 @@
    f43be0
     #include "config.h"
    f43be0
     
    f43be0
     #include "strerror_override.h"
    f43be0
     
    f43be0
     #include <assert.h>
    f43be0
    -#include <ctype.h>
    f43be0
     #ifdef HAVE_LIMITS_H
    f43be0
     #include <limits.h>
    f43be0
     #endif
    f43be0
     #include <math.h>
    f43be0
     #include <stddef.h>
    f43be0
    @@ -33,12 +32,15 @@
    f43be0
     #include "math_compat.h"
    f43be0
     #include "printbuf.h"
    f43be0
     #include "snprintf_compat.h"
    f43be0
     #include "strdup_compat.h"
    f43be0
     
    f43be0
    +/* Avoid ctype.h and locale overhead */
    f43be0
    +#define is_plain_digit(c) ((c) >= '0' && (c) <= '9')
    f43be0
    +
    f43be0
     #if SIZEOF_LONG_LONG != SIZEOF_INT64_T
    f43be0
    -#error "The long long type isn't 64-bits"
    f43be0
    +#error The long long type is not 64-bits
    f43be0
     #endif
    f43be0
     
    f43be0
     #ifndef SSIZE_T_MAX
    f43be0
     #if SIZEOF_SSIZE_T == SIZEOF_INT
    f43be0
     #define SSIZE_T_MAX INT_MAX
    f43be0
    @@ -49,13 +51,10 @@
    f43be0
     #else
    f43be0
     #error Unable to determine size of ssize_t
    f43be0
     #endif
    f43be0
     #endif
    f43be0
     
    f43be0
    -// Don't define this.  It's not thread-safe.
    f43be0
    -/* #define REFCOUNT_DEBUG 1 */
    f43be0
    -
    f43be0
     const char *json_hex_chars = "0123456789abcdefABCDEF";
    f43be0
     
    f43be0
     static void json_object_generic_delete(struct json_object *jso);
    f43be0
     
    f43be0
     #if defined(_MSC_VER) && (_MSC_VER <= 1800)
    f43be0
    @@ -157,45 +156,10 @@ static json_object_to_json_string_fn _js
    f43be0
      * This should be used rather than assert() for unconditional abortion
    f43be0
      * (in particular for code paths which are never supposed to be run).
    f43be0
      * */
    f43be0
     JSON_NORETURN static void json_abort(const char *message);
    f43be0
     
    f43be0
    -/* ref count debugging */
    f43be0
    -
    f43be0
    -#ifdef REFCOUNT_DEBUG
    f43be0
    -
    f43be0
    -static struct lh_table *json_object_table;
    f43be0
    -
    f43be0
    -static void json_object_init(void) __attribute__((constructor));
    f43be0
    -static void json_object_init(void)
    f43be0
    -{
    f43be0
    -	MC_DEBUG("json_object_init: creating object table\n");
    f43be0
    -	json_object_table = lh_kptr_table_new(128, NULL);
    f43be0
    -}
    f43be0
    -
    f43be0
    -static void json_object_fini(void) __attribute__((destructor));
    f43be0
    -static void json_object_fini(void)
    f43be0
    -{
    f43be0
    -	struct lh_entry *ent;
    f43be0
    -	if (MC_GET_DEBUG())
    f43be0
    -	{
    f43be0
    -		if (json_object_table->count)
    f43be0
    -		{
    f43be0
    -			MC_DEBUG("json_object_fini: %d referenced objects at exit\n",
    f43be0
    -			         json_object_table->count);
    f43be0
    -			lh_foreach(json_object_table, ent)
    f43be0
    -			{
    f43be0
    -				struct json_object *obj = (struct json_object *)lh_entry_v(ent);
    f43be0
    -				MC_DEBUG("\t%s:%p\n", json_type_to_name(obj->o_type), obj);
    f43be0
    -			}
    f43be0
    -		}
    f43be0
    -	}
    f43be0
    -	MC_DEBUG("json_object_fini: freeing object table\n");
    f43be0
    -	lh_table_free(json_object_table);
    f43be0
    -}
    f43be0
    -#endif /* REFCOUNT_DEBUG */
    f43be0
    -
    f43be0
     /* helper for accessing the optimized string data component in json_object
    f43be0
      */
    f43be0
     static inline char *get_string_component_mutable(struct json_object *jso)
    f43be0
     {
    f43be0
     	if (JC_STRING_C(jso)->len < 0)
    f43be0
    @@ -212,14 +176,15 @@ static inline const char *get_string_com
    f43be0
     
    f43be0
     /* string escaping */
    f43be0
     
    f43be0
     static int json_escape_str(struct printbuf *pb, const char *str, size_t len, int flags)
    f43be0
     {
    f43be0
    -	int pos = 0, start_offset = 0;
    f43be0
    +	size_t pos = 0, start_offset = 0;
    f43be0
     	unsigned char c;
    f43be0
    -	while (len--)
    f43be0
    +	while (len)
    f43be0
     	{
    f43be0
    +		--len;
    f43be0
     		c = str[pos];
    f43be0
     		switch (c)
    f43be0
     		{
    f43be0
     		case '\b':
    f43be0
     		case '\n':
    f43be0
    @@ -233,11 +198,11 @@ static int json_escape_str(struct printb
    f43be0
     			{
    f43be0
     				pos++;
    f43be0
     				break;
    f43be0
     			}
    f43be0
     
    f43be0
    -			if (pos - start_offset > 0)
    f43be0
    +			if (pos > start_offset)
    f43be0
     				printbuf_memappend(pb, str + start_offset, pos - start_offset);
    f43be0
     
    f43be0
     			if (c == '\b')
    f43be0
     				printbuf_memappend(pb, "\\b", 2);
    f43be0
     			else if (c == '\n')
    f43be0
    @@ -259,11 +224,11 @@ static int json_escape_str(struct printb
    f43be0
     			break;
    f43be0
     		default:
    f43be0
     			if (c < ' ')
    f43be0
     			{
    f43be0
     				char sbuf[7];
    f43be0
    -				if (pos - start_offset > 0)
    f43be0
    +				if (pos > start_offset)
    f43be0
     					printbuf_memappend(pb, str + start_offset,
    f43be0
     					                   pos - start_offset);
    f43be0
     				snprintf(sbuf, sizeof(sbuf), "\\u00%c%c", json_hex_chars[c >> 4],
    f43be0
     				         json_hex_chars[c & 0xf]);
    f43be0
     				printbuf_memappend_fast(pb, sbuf, (int)sizeof(sbuf) - 1);
    f43be0
    @@ -271,11 +236,11 @@ static int json_escape_str(struct printb
    f43be0
     			}
    f43be0
     			else
    f43be0
     				pos++;
    f43be0
     		}
    f43be0
     	}
    f43be0
    -	if (pos - start_offset > 0)
    f43be0
    +	if (pos > start_offset)
    f43be0
     		printbuf_memappend(pb, str + start_offset, pos - start_offset);
    f43be0
     	return 0;
    f43be0
     }
    f43be0
     
    f43be0
     /* reference counting */
    f43be0
    @@ -335,14 +300,10 @@ int json_object_put(struct json_object *
    f43be0
     
    f43be0
     /* generic object construction and destruction parts */
    f43be0
     
    f43be0
     static void json_object_generic_delete(struct json_object *jso)
    f43be0
     {
    f43be0
    -#ifdef REFCOUNT_DEBUG
    f43be0
    -	MC_DEBUG("json_object_delete_%s: %p\n", json_type_to_name(jso->o_type), jso);
    f43be0
    -	lh_table_delete(json_object_table, jso);
    f43be0
    -#endif /* REFCOUNT_DEBUG */
    f43be0
     	printbuf_free(jso->_pb);
    f43be0
     	free(jso);
    f43be0
     }
    f43be0
     
    f43be0
     static inline struct json_object *json_object_new(enum json_type o_type, size_t alloc_size,
    f43be0
    @@ -360,14 +321,10 @@ static inline struct json_object *json_o
    f43be0
     	jso->_pb = NULL;
    f43be0
     	jso->_user_delete = NULL;
    f43be0
     	jso->_userdata = NULL;
    f43be0
     	//jso->...   // Type-specific fields must be set by caller
    f43be0
     
    f43be0
    -#ifdef REFCOUNT_DEBUG
    f43be0
    -	lh_table_insert(json_object_table, jso, jso);
    f43be0
    -	MC_DEBUG("json_object_new_%s: %p\n", json_type_to_name(jso->o_type), jso);
    f43be0
    -#endif /* REFCOUNT_DEBUG */
    f43be0
     	return jso;
    f43be0
     }
    f43be0
     
    f43be0
     /* type checking functions */
    f43be0
     
    f43be0
    @@ -540,11 +497,11 @@ static int json_object_object_to_json_st
    f43be0
     		return printbuf_strappend(pb, /*{*/ "}");
    f43be0
     }
    f43be0
     
    f43be0
     static void json_object_lh_entry_free(struct lh_entry *ent)
    f43be0
     {
    f43be0
    -	if (!ent->k_is_constant)
    f43be0
    +	if (!lh_entry_k_is_constant(ent))
    f43be0
     		free(lh_entry_k(ent));
    f43be0
     	json_object_put((struct json_object *)lh_entry_v(ent));
    f43be0
     }
    f43be0
     
    f43be0
     static void json_object_object_delete(struct json_object *jso_base)
    f43be0
    @@ -603,19 +560,19 @@ int json_object_object_add_ex(struct jso
    f43be0
     		return -1;
    f43be0
     
    f43be0
     	if (!existing_entry)
    f43be0
     	{
    f43be0
     		const void *const k =
    f43be0
    -		    (opts & JSON_C_OBJECT_KEY_IS_CONSTANT) ? (const void *)key : strdup(key);
    f43be0
    +		    (opts & JSON_C_OBJECT_ADD_CONSTANT_KEY) ? (const void *)key : strdup(key);
    f43be0
     		if (k == NULL)
    f43be0
     			return -1;
    f43be0
     		return lh_table_insert_w_hash(JC_OBJECT(jso)->c_object, k, val, hash, opts);
    f43be0
     	}
    f43be0
     	existing_value = (json_object *)lh_entry_v(existing_entry);
    f43be0
     	if (existing_value)
    f43be0
     		json_object_put(existing_value);
    f43be0
    -	existing_entry->v = val;
    f43be0
    +	lh_entry_set_val(existing_entry, val);
    f43be0
     	return 0;
    f43be0
     }
    f43be0
     
    f43be0
     int json_object_object_add(struct json_object *jso, const char *key, struct json_object *val)
    f43be0
     {
    f43be0
    @@ -733,11 +690,11 @@ struct json_object *json_object_new_int(
    f43be0
     	return json_object_new_int64(i);
    f43be0
     }
    f43be0
     
    f43be0
     int32_t json_object_get_int(const struct json_object *jso)
    f43be0
     {
    f43be0
    -	int64_t cint64=0;
    f43be0
    +	int64_t cint64 = 0;
    f43be0
     	double cdouble;
    f43be0
     	enum json_type o_type;
    f43be0
     
    f43be0
     	if (!jso)
    f43be0
     		return 0;
    f43be0
    @@ -974,30 +931,59 @@ int json_c_set_serialization_double_form
    f43be0
     			tls_serialization_float_format = NULL;
    f43be0
     		}
    f43be0
     #endif
    f43be0
     		if (global_serialization_float_format)
    f43be0
     			free(global_serialization_float_format);
    f43be0
    -		global_serialization_float_format = double_format ? strdup(double_format) : NULL;
    f43be0
    +		if (double_format)
    f43be0
    +		{
    f43be0
    +			char *p = strdup(double_format);
    f43be0
    +			if (p == NULL)
    f43be0
    +			{
    f43be0
    +				_json_c_set_last_err("json_c_set_serialization_double_format: "
    f43be0
    +				                     "out of memory\n");
    f43be0
    +				return -1;
    f43be0
    +			}
    f43be0
    +			global_serialization_float_format = p;
    f43be0
    +		}
    f43be0
    +		else
    f43be0
    +		{
    f43be0
    +			global_serialization_float_format = NULL;
    f43be0
    +		}
    f43be0
     	}
    f43be0
     	else if (global_or_thread == JSON_C_OPTION_THREAD)
    f43be0
     	{
    f43be0
     #if defined(HAVE___THREAD)
    f43be0
     		if (tls_serialization_float_format)
    f43be0
     		{
    f43be0
     			free(tls_serialization_float_format);
    f43be0
     			tls_serialization_float_format = NULL;
    f43be0
     		}
    f43be0
    -		tls_serialization_float_format = double_format ? strdup(double_format) : NULL;
    f43be0
    +		if (double_format)
    f43be0
    +		{
    f43be0
    +			char *p = strdup(double_format);
    f43be0
    +			if (p == NULL)
    f43be0
    +			{
    f43be0
    +				_json_c_set_last_err("json_c_set_serialization_double_format: "
    f43be0
    +				                     "out of memory\n");
    f43be0
    +				return -1;
    f43be0
    +			}
    f43be0
    +			tls_serialization_float_format = p;
    f43be0
    +		}
    f43be0
    +		else
    f43be0
    +		{
    f43be0
    +			tls_serialization_float_format = NULL;
    f43be0
    +		}
    f43be0
     #else
    f43be0
    -		_json_c_set_last_err("json_c_set_option: not compiled with __thread support\n");
    f43be0
    +		_json_c_set_last_err("json_c_set_serialization_double_format: not compiled "
    f43be0
    +		                     "with __thread support\n");
    f43be0
     		return -1;
    f43be0
     #endif
    f43be0
     	}
    f43be0
     	else
    f43be0
     	{
    f43be0
    -		_json_c_set_last_err("json_c_set_option: invalid global_or_thread value: %d\n",
    f43be0
    -		                     global_or_thread);
    f43be0
    +		_json_c_set_last_err("json_c_set_serialization_double_format: invalid "
    f43be0
    +		                     "global_or_thread value: %d\n", global_or_thread);
    f43be0
     		return -1;
    f43be0
     	}
    f43be0
     	return 0;
    f43be0
     }
    f43be0
     
    f43be0
    @@ -1054,12 +1040,11 @@ static int json_object_double_to_json_st
    f43be0
     
    f43be0
     		if (format == std_format || strstr(format, ".0f") == NULL)
    f43be0
     			format_drops_decimals = 1;
    f43be0
     
    f43be0
     		looks_numeric = /* Looks like *some* kind of number */
    f43be0
    -		    isdigit((unsigned char)buf[0]) ||
    f43be0
    -		    (size > 1 && buf[0] == '-' && isdigit((unsigned char)buf[1]));
    f43be0
    +		    is_plain_digit(buf[0]) || (size > 1 && buf[0] == '-' && is_plain_digit(buf[1]));
    f43be0
     
    f43be0
     		if (size < (int)sizeof(buf) - 2 && looks_numeric && !p && /* Has no decimal point */
    f43be0
     		    strchr(buf, 'e') == NULL && /* Not scientific notation */
    f43be0
     		    format_drops_decimals)
    f43be0
     		{
    f43be0
    @@ -1252,21 +1237,21 @@ static struct json_object *_json_object_
    f43be0
     {
    f43be0
     	size_t objsize;
    f43be0
     	struct json_object_string *jso;
    f43be0
     
    f43be0
     	/*
    f43be0
    -     * Structures           Actual memory layout
    f43be0
    -     * -------------------  --------------------
    f43be0
    +	 * Structures           Actual memory layout
    f43be0
    +	 * -------------------  --------------------
    f43be0
     	 * [json_object_string  [json_object_string
    f43be0
     	 *  [json_object]        [json_object]
    f43be0
    -     *  ...other fields...   ...other fields...
    f43be0
    +	 *  ...other fields...   ...other fields...
    f43be0
     	 *  c_string]            len
    f43be0
    -     *                       bytes
    f43be0
    +	 *                       bytes
    f43be0
     	 *                       of
    f43be0
     	 *                       string
    f43be0
     	 *                       data
    f43be0
    -     *                       \0]
    f43be0
    +	 *                       \0]
    f43be0
     	 */
    f43be0
     	if (len > (SSIZE_T_MAX - (sizeof(*jso) - sizeof(jso->c_string)) - 1))
    f43be0
     		return NULL;
    f43be0
     	objsize = (sizeof(*jso) - sizeof(jso->c_string)) + len + 1;
    f43be0
     	if (len < sizeof(void *))
    f43be0
    @@ -1279,11 +1264,12 @@ static struct json_object *_json_object_
    f43be0
     
    f43be0
     	if (!jso)
    f43be0
     		return NULL;
    f43be0
     	jso->len = len;
    f43be0
     	memcpy(jso->c_string.idata, s, len);
    f43be0
    -	jso->c_string.idata[len] = '\0';
    f43be0
    +	// Cast below needed for Clang UB sanitizer
    f43be0
    +	((char *)jso->c_string.idata)[len] = '\0';
    f43be0
     	return &jso->base;
    f43be0
     }
    f43be0
     
    f43be0
     struct json_object *json_object_new_string(const char *s)
    f43be0
     {
    f43be0
    @@ -1303,22 +1289,24 @@ const char *json_object_get_string(struc
    f43be0
     	{
    f43be0
     	case json_type_string: return get_string_component(jso);
    f43be0
     	default: return json_object_to_json_string(jso);
    f43be0
     	}
    f43be0
     }
    f43be0
    +
    f43be0
    +static inline ssize_t _json_object_get_string_len(const struct json_object_string *jso)
    f43be0
    +{
    f43be0
    +	ssize_t len;
    f43be0
    +	len = jso->len;
    f43be0
    +	return (len < 0) ? -(ssize_t)len : len;
    f43be0
    +}
    f43be0
     int json_object_get_string_len(const struct json_object *jso)
    f43be0
     {
    f43be0
    -	ssize_t len;
    f43be0
     	if (!jso)
    f43be0
     		return 0;
    f43be0
     	switch (jso->o_type)
    f43be0
     	{
    f43be0
    -	case json_type_string:
    f43be0
    -	{
    f43be0
    -		len = JC_STRING_C(jso)->len;
    f43be0
    -		return (len < 0) ? -(ssize_t)len : len;
    f43be0
    -	}
    f43be0
    +	case json_type_string: return _json_object_get_string_len(JC_STRING_C(jso));
    f43be0
     	default: return 0;
    f43be0
     	}
    f43be0
     }
    f43be0
     
    f43be0
     static int _json_object_set_string_len(json_object *jso, const char *s, size_t len)
    f43be0
    @@ -1327,13 +1315,14 @@ static int _json_object_set_string_len(j
    f43be0
     	ssize_t curlen;
    f43be0
     	ssize_t newlen;
    f43be0
     	if (jso == NULL || jso->o_type != json_type_string)
    f43be0
     		return 0;
    f43be0
     
    f43be0
    -	if (len >= SSIZE_T_MAX - 1)
    f43be0
    +	if (len >= INT_MAX - 1)
    f43be0
     		// jso->len is a signed ssize_t, so it can't hold the
    f43be0
    -		// full size_t range.
    f43be0
    +		// full size_t range. json_object_get_string_len returns
    f43be0
    +		// length as int, cap length at INT_MAX.
    f43be0
     		return 0;
    f43be0
     
    f43be0
     	dstbuf = get_string_component_mutable(jso);
    f43be0
     	curlen = JC_STRING(jso)->len;
    f43be0
     	if (curlen < 0)
    f43be0
    @@ -1603,13 +1592,14 @@ int json_object_equal(struct json_object
    f43be0
     		return (int1->cint.c_uint64 == (uint64_t)int2->cint.c_int64);
    f43be0
     	}
    f43be0
     
    f43be0
     	case json_type_string:
    f43be0
     	{
    f43be0
    -		return (json_object_get_string_len(jso1) == json_object_get_string_len(jso2) &&
    f43be0
    +		return (_json_object_get_string_len(JC_STRING(jso1)) ==
    f43be0
    +		            _json_object_get_string_len(JC_STRING(jso2)) &&
    f43be0
     		        memcmp(get_string_component(jso1), get_string_component(jso2),
    f43be0
    -		               json_object_get_string_len(jso1)) == 0);
    f43be0
    +		               _json_object_get_string_len(JC_STRING(jso1))) == 0);
    f43be0
     	}
    f43be0
     
    f43be0
     	case json_type_object: return json_object_all_values_equal(jso1, jso2);
    f43be0
     
    f43be0
     	case json_type_array: return json_array_equal(jso1, jso2);
    f43be0
    @@ -1626,18 +1616,26 @@ static int json_object_copy_serializer_d
    f43be0
     		return 0;
    f43be0
     
    f43be0
     	if (dst->_to_json_string == json_object_userdata_to_json_string ||
    f43be0
     	    dst->_to_json_string == _json_object_userdata_to_json_string)
    f43be0
     	{
    f43be0
    -		dst->_userdata = strdup(src->_userdata);
    f43be0
    +		char *p;
    f43be0
    +		assert(src->_userdata);
    f43be0
    +		p = strdup(src->_userdata);
    f43be0
    +		if (p == NULL)
    f43be0
    +		{
    f43be0
    +			_json_c_set_last_err("json_object_copy_serializer_data: out of memory\n");
    f43be0
    +			return -1;
    f43be0
    +		}
    f43be0
    +		dst->_userdata = p;
    f43be0
     	}
    f43be0
     	// else if ... other supported serializers ...
    f43be0
     	else
    f43be0
     	{
    f43be0
     		_json_c_set_last_err(
    f43be0
    -		    "json_object_deep_copy: unable to copy unknown serializer data: %p\n",
    f43be0
    -		    (void *)dst->_to_json_string);
    f43be0
    +		    "json_object_copy_serializer_data: unable to copy unknown serializer data: "
    f43be0
    +		    "%p\n", (void *)dst->_to_json_string);
    f43be0
     		return -1;
    f43be0
     	}
    f43be0
     	dst->_user_delete = src->_user_delete;
    f43be0
     	return 0;
    f43be0
     }
    f43be0
    @@ -1670,11 +1668,14 @@ int json_c_shallow_copy_default(json_obj
    f43be0
     			break;
    f43be0
     		default: json_abort("invalid cint_type");
    f43be0
     		}
    f43be0
     		break;
    f43be0
     
    f43be0
    -	case json_type_string: *dst = json_object_new_string(get_string_component(src)); break;
    f43be0
    +	case json_type_string:
    f43be0
    +		*dst = json_object_new_string_len(get_string_component(src),
    f43be0
    +		                                  _json_object_get_string_len(JC_STRING(src)));
    f43be0
    +		break;
    f43be0
     
    f43be0
     	case json_type_object: *dst = json_object_new_object(); break;
    f43be0
     
    f43be0
     	case json_type_array: *dst = json_object_new_array(); break;
    f43be0
     
    f43be0
    @@ -1722,12 +1723,12 @@ static int json_object_deep_copy_recursi
    f43be0
     		{
    f43be0
     			struct json_object *jso = NULL;
    f43be0
     			/* This handles the `json_type_null` case */
    f43be0
     			if (!iter.val)
    f43be0
     				jso = NULL;
    f43be0
    -			else if (json_object_deep_copy_recursive(iter.val, src, iter.key, -1, &jso,
    f43be0
    -			                                         shallow_copy) < 0)
    f43be0
    +			else if (json_object_deep_copy_recursive(iter.val, src, iter.key, UINT_MAX,
    f43be0
    +			                                         &jso, shallow_copy) < 0)
    f43be0
     			{
    f43be0
     				json_object_put(jso);
    f43be0
     				return -1;
    f43be0
     			}
    f43be0
     
    f43be0
    @@ -1787,11 +1788,11 @@ int json_object_deep_copy(struct json_ob
    f43be0
     	}
    f43be0
     
    f43be0
     	if (shallow_copy == NULL)
    f43be0
     		shallow_copy = json_c_shallow_copy_default;
    f43be0
     
    f43be0
    -	rc = json_object_deep_copy_recursive(src, NULL, NULL, -1, dst, shallow_copy);
    f43be0
    +	rc = json_object_deep_copy_recursive(src, NULL, NULL, UINT_MAX, dst, shallow_copy);
    f43be0
     	if (rc < 0)
    f43be0
     	{
    f43be0
     		json_object_put(*dst);
    f43be0
     		*dst = NULL;
    f43be0
     	}
    f43be0
    diff --git a/comm/third_party/json-c/json_object.h b/third_party/json-c/json_ob/commject.h
    f43be0
    --- a/comm/third_party/json-c/json_object.h
    f43be0
    +++ b/comm/third_party/json-c/json_object.h
    f43be0
    @@ -50,11 +50,11 @@ extern "C" {
    f43be0
     /**
    f43be0
      * A flag for the json_object_to_json_string_ext() and
    f43be0
      * json_object_to_file_ext() functions which causes
    f43be0
      * the output to be formatted.
    f43be0
      *
    f43be0
    - * See the "Two Space Tab" option at http://jsonformatter.curiousconcept.com/
    f43be0
    + * See the "Two Space Tab" option at https://jsonformatter.curiousconcept.com/
    f43be0
      * for an example of the format.
    f43be0
      */
    f43be0
     #define JSON_C_TO_STRING_PRETTY (1 << 1)
    f43be0
     /**
    f43be0
      * A flag for the json_object_to_json_string_ext() and
    f43be0
    @@ -98,13 +98,21 @@ extern "C" {
    f43be0
      * justified.
    f43be0
      * The general use-case for this flag is cases where the
    f43be0
      * key is given as a real constant value in the function
    f43be0
      * call, e.g. as in
    f43be0
      *   json_object_object_add_ex(obj, "ip", json,
    f43be0
    - *       JSON_C_OBJECT_KEY_IS_CONSTANT);
    f43be0
    + *       JSON_C_OBJECT_ADD_CONSTANT_KEY);
    f43be0
      */
    f43be0
    -#define JSON_C_OBJECT_KEY_IS_CONSTANT (1 << 2)
    f43be0
    +#define JSON_C_OBJECT_ADD_CONSTANT_KEY (1 << 2)
    f43be0
    +/**
    f43be0
    + * This flag is an alias to JSON_C_OBJECT_ADD_CONSTANT_KEY.
    f43be0
    + * Historically, this flag was used first and the new name
    f43be0
    + * JSON_C_OBJECT_ADD_CONSTANT_KEY was introduced for version
    f43be0
    + * 0.16.00 in order to have regular naming.
    f43be0
    + * Use of this flag is now legacy.
    f43be0
    + */
    f43be0
    +#define JSON_C_OBJECT_KEY_IS_CONSTANT  JSON_C_OBJECT_ADD_CONSTANT_KEY
    f43be0
     
    f43be0
     /**
    f43be0
      * Set the global value of an option, which will apply to all
    f43be0
      * current and future threads that have not set a thread-local value.
    f43be0
      *
    f43be0
    @@ -129,11 +137,11 @@ extern "C" {
    f43be0
      * - Using an object field or array index (retrieved through
    f43be0
      *    `json_object_object_get()` or `json_object_array_get_idx()`)
    f43be0
      *    beyond the lifetime of the parent object.
    f43be0
      * - Detaching an object field or array index from its parent object
    f43be0
      *    (using `json_object_object_del()` or `json_object_array_del_idx()`)
    f43be0
    - * - Sharing a json_object with multiple (not necesarily parallel) threads
    f43be0
    + * - Sharing a json_object with multiple (not necessarily parallel) threads
    f43be0
      *    of execution that all expect to free it (with `json_object_put()`) when
    f43be0
      *    they're done.
    f43be0
      *
    f43be0
      * @param obj the json_object instance
    f43be0
      * @see json_object_put()
    f43be0
    @@ -468,23 +476,23 @@ JSON_EXPORT void json_object_object_del(
    f43be0
      * @param obj the json_object instance
    f43be0
      * @param key the local name for the char* key variable defined in the body
    f43be0
      * @param val the local name for the json_object* object variable defined in
    f43be0
      *            the body
    f43be0
      */
    f43be0
    -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
    f43be0
    +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
    f43be0
     
    f43be0
     #define json_object_object_foreach(obj, key, val)                                \
    f43be0
     	char *key = NULL;                                                        \
    f43be0
     	struct json_object *val __attribute__((__unused__)) = NULL;              \
    f43be0
    -	for (struct lh_entry *entry##key = json_object_get_object(obj)->head,    \
    f43be0
    +	for (struct lh_entry *entry##key = lh_table_head(json_object_get_object(obj)),    \
    f43be0
     	                     *entry_next##key = NULL;                            \
    f43be0
     	     ({                                                                  \
    f43be0
     		     if (entry##key)                                             \
    f43be0
     		     {                                                           \
    f43be0
     			     key = (char *)lh_entry_k(entry##key);               \
    f43be0
     			     val = (struct json_object *)lh_entry_v(entry##key); \
    f43be0
    -			     entry_next##key = entry##key->next;                 \
    f43be0
    +			     entry_next##key = lh_entry_next(entry##key);        \
    f43be0
     		     };                                                          \
    f43be0
     		     entry##key;                                                 \
    f43be0
     	     });                                                                 \
    f43be0
     	     entry##key = entry_next##key)
    f43be0
     
    f43be0
    @@ -493,29 +501,29 @@ JSON_EXPORT void json_object_object_del(
    f43be0
     #define json_object_object_foreach(obj, key, val)                              \
    f43be0
     	char *key = NULL;                                                      \
    f43be0
     	struct json_object *val = NULL;                                        \
    f43be0
     	struct lh_entry *entry##key;                                           \
    f43be0
     	struct lh_entry *entry_next##key = NULL;                               \
    f43be0
    -	for (entry##key = json_object_get_object(obj)->head;                   \
    f43be0
    +	for (entry##key = lh_table_head(json_object_get_object(obj));          \
    f43be0
     	     (entry##key ? (key = (char *)lh_entry_k(entry##key),              \
    f43be0
     	                   val = (struct json_object *)lh_entry_v(entry##key), \
    f43be0
    -	                   entry_next##key = entry##key->next, entry##key)     \
    f43be0
    +	                   entry_next##key = lh_entry_next(entry##key), entry##key)     \
    f43be0
     	                 : 0);                                                 \
    f43be0
     	     entry##key = entry_next##key)
    f43be0
     
    f43be0
    -#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L */
    f43be0
    +#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */
    f43be0
     
    f43be0
     /** Iterate through all keys and values of an object (ANSI C Safe)
    f43be0
      * @param obj the json_object instance
    f43be0
      * @param iter the object iterator, use type json_object_iter
    f43be0
      */
    f43be0
     #define json_object_object_foreachC(obj, iter)                                                  \
    f43be0
    -	for (iter.entry = json_object_get_object(obj)->head;                                    \
    f43be0
    +	for (iter.entry = lh_table_head(json_object_get_object(obj));                                    \
    f43be0
     	     (iter.entry ? (iter.key = (char *)lh_entry_k(iter.entry),                          \
    f43be0
     	                   iter.val = (struct json_object *)lh_entry_v(iter.entry), iter.entry) \
    f43be0
     	                 : 0);                                                                  \
    f43be0
    -	     iter.entry = iter.entry->next)
    f43be0
    +	     iter.entry = lh_entry_next(iter.entry))
    f43be0
     
    f43be0
     /* Array type methods */
    f43be0
     
    f43be0
     /** Create a new empty json_object of type json_type_array
    f43be0
      * with 32 slots allocated.
    f43be0
    @@ -654,12 +662,13 @@ JSON_EXPORT struct json_object *json_obj
    f43be0
     /** Get the json_bool value of a json_object
    f43be0
      *
    f43be0
      * The type is coerced to a json_bool if the passed object is not a json_bool.
    f43be0
      * integer and double objects will return 0 if there value is zero
    f43be0
      * or 1 otherwise. If the passed object is a string it will return
    f43be0
    - * 1 if it has a non zero length. If any other object type is passed
    f43be0
    - * 1 will be returned if the object is not NULL.
    f43be0
    + * 1 if it has a non zero length. 
    f43be0
    + * If any other object type is passed 0 will be returned, even non-empty
    f43be0
    + *  json_type_array and json_type_object objects.
    f43be0
      *
    f43be0
      * @param obj the json_object instance
    f43be0
      * @returns a json_bool
    f43be0
      */
    f43be0
     JSON_EXPORT json_bool json_object_get_boolean(const struct json_object *obj);
    f43be0
    @@ -736,11 +745,11 @@ JSON_EXPORT int json_object_set_int(stru
    f43be0
      * is set to INT64_MIN.
    f43be0
      * Neither overflow nor underflow affect the return value.
    f43be0
      *
    f43be0
      * @param obj the json_object instance
    f43be0
      * @param val the value to add
    f43be0
    - * @returns 1 if the increment succeded, 0 otherwise
    f43be0
    + * @returns 1 if the increment succeeded, 0 otherwise
    f43be0
      */
    f43be0
     JSON_EXPORT int json_object_int_inc(struct json_object *obj, int64_t val);
    f43be0
     
    f43be0
     /** Get the int value of a json_object
    f43be0
      *
    f43be0
    @@ -1053,11 +1062,11 @@ JSON_EXPORT json_c_shallow_copy_fn json_
    f43be0
      *            make sure this pointer is initialized to NULL
    f43be0
      * @param shallow_copy an optional function to copy individual objects, needed
    f43be0
      *                     when custom serializers are in use.  See also
    f43be0
      *                     json_object set_serializer.
    f43be0
      *
    f43be0
    - * @returns 0 if the copy went well, -1 if an error occured during copy
    f43be0
    + * @returns 0 if the copy went well, -1 if an error occurred during copy
    f43be0
      *          or if the destination pointer is non-NULL
    f43be0
      */
    f43be0
     
    f43be0
     JSON_EXPORT int json_object_deep_copy(struct json_object *src, struct json_object **dst,
    f43be0
                                           json_c_shallow_copy_fn *shallow_copy);
    f43be0
    diff --git a/comm/third_party/json-c/json_object_iterator.c b/third_party/json-c/json_ob/commject_iterator.c
    f43be0
    --- a/comm/third_party/json-c/json_object_iterator.c
    f43be0
    +++ b/comm/third_party/json-c/json_object_iterator.c
    f43be0
    @@ -69,11 +69,11 @@ struct json_object_iterator json_object_
    f43be0
     	pTable = json_object_get_object(obj);
    f43be0
     	JASSERT(NULL != pTable);
    f43be0
     
    f43be0
     	/// @note For a pair-less Object, head is NULL, which matches our
    f43be0
     	///       definition of the "end" iterator
    f43be0
    -	iter.opaque_ = pTable->head;
    f43be0
    +	iter.opaque_ = lh_table_head(pTable);
    f43be0
     	return iter;
    f43be0
     }
    f43be0
     
    f43be0
     /**
    f43be0
      * ****************************************************************************
    f43be0
    @@ -96,11 +96,11 @@ struct json_object_iterator json_object_
    f43be0
     void json_object_iter_next(struct json_object_iterator *iter)
    f43be0
     {
    f43be0
     	JASSERT(NULL != iter);
    f43be0
     	JASSERT(kObjectEndIterValue != iter->opaque_);
    f43be0
     
    f43be0
    -	iter->opaque_ = ((const struct lh_entry *)iter->opaque_)->next;
    f43be0
    +	iter->opaque_ = lh_entry_next(((const struct lh_entry *)iter->opaque_));
    f43be0
     }
    f43be0
     
    f43be0
     /**
    f43be0
      * ****************************************************************************
    f43be0
      */
    f43be0
    diff --git a/comm/third_party/json-c/json_pointer.c b/comm/third_party/json-c/json_pointer.c
    f43be0
    --- a/comm/third_party/json-c/json_pointer.c
    f43be0
    +++ b/comm/third_party/json-c/json_pointer.c
    f43be0
    @@ -8,20 +8,22 @@
    f43be0
     
    f43be0
     #include "config.h"
    f43be0
     
    f43be0
     #include "strerror_override.h"
    f43be0
     
    f43be0
    -#include <ctype.h>
    f43be0
     #include <stdarg.h>
    f43be0
     #include <stdio.h>
    f43be0
     #include <stdlib.h>
    f43be0
     #include <string.h>
    f43be0
     
    f43be0
     #include "json_pointer.h"
    f43be0
     #include "strdup_compat.h"
    f43be0
     #include "vasprintf_compat.h"
    f43be0
     
    f43be0
    +/* Avoid ctype.h and locale overhead */
    f43be0
    +#define is_plain_digit(c) ((c) >= '0' && (c) <= '9')
    f43be0
    +
    f43be0
     /**
    f43be0
      * JavaScript Object Notation (JSON) Pointer
    f43be0
      *   RFC 6901 - https://tools.ietf.org/html/rfc6901
    f43be0
      */
    f43be0
     
    f43be0
    @@ -45,11 +47,11 @@ static int is_valid_index(struct json_ob
    f43be0
     	/* this code-path optimizes a bit, for when we reference the 0-9 index range
    f43be0
     	 * in a JSON array and because leading zeros not allowed
    f43be0
     	 */
    f43be0
     	if (len == 1)
    f43be0
     	{
    f43be0
    -		if (isdigit((unsigned char)path[0]))
    f43be0
    +		if (is_plain_digit(path[0]))
    f43be0
     		{
    f43be0
     			*idx = (path[0] - '0');
    f43be0
     			goto check_oob;
    f43be0
     		}
    f43be0
     		errno = EINVAL;
    f43be0
    @@ -62,11 +64,11 @@ static int is_valid_index(struct json_ob
    f43be0
     		return 0;
    f43be0
     	}
    f43be0
     	/* RFC states base-10 decimals */
    f43be0
     	for (i = 0; i < len; i++)
    f43be0
     	{
    f43be0
    -		if (!isdigit((unsigned char)path[i]))
    f43be0
    +		if (!is_plain_digit(path[i]))
    f43be0
     		{
    f43be0
     			errno = EINVAL;
    f43be0
     			return 0;
    f43be0
     		}
    f43be0
     	}
    f43be0
    diff --git a/comm/third_party/json-c/json_tokener.c b/comm/third_party/json-c/json_tokener.c
    f43be0
    --- a/comm/third_party/json-c/json_tokener.c
    f43be0
    +++ b/comm/third_party/json-c/json_tokener.c
    f43be0
    @@ -8,18 +8,17 @@
    f43be0
      * it under the terms of the MIT license. See COPYING for details.
    f43be0
      *
    f43be0
      *
    f43be0
      * Copyright (c) 2008-2009 Yahoo! Inc.  All rights reserved.
    f43be0
      * The copyrights to the contents of this file are licensed under the MIT License
    f43be0
    - * (http://www.opensource.org/licenses/mit-license.php)
    f43be0
    + * (https://www.opensource.org/licenses/mit-license.php)
    f43be0
      */
    f43be0
     
    f43be0
     #include "config.h"
    f43be0
     
    f43be0
     #include "math_compat.h"
    f43be0
     #include <assert.h>
    f43be0
    -#include <ctype.h>
    f43be0
     #include <limits.h>
    f43be0
     #include <math.h>
    f43be0
     #include <stddef.h>
    f43be0
     #include <stdio.h>
    f43be0
     #include <stdlib.h>
    f43be0
    @@ -51,19 +50,48 @@
    f43be0
     #define strncasecmp _strnicmp
    f43be0
     #elif !HAVE_STRNCASECMP
    f43be0
     #error You do not have strncasecmp on your system.
    f43be0
     #endif /* HAVE_STRNCASECMP */
    f43be0
     
    f43be0
    +#if defined(_MSC_VER) && (_MSC_VER <= 1800)
    f43be0
    +/* VS2013 doesn't know about "inline" */
    f43be0
    +#define inline __inline
    f43be0
    +#elif defined(AIX_CC)
    f43be0
    +#define inline
    f43be0
    +#endif
    f43be0
    +
    f43be0
    +/* The following helper functions are used to speed up parsing. They
    f43be0
    + * are faster than their ctype counterparts because they assume that
    f43be0
    + * the input is in ASCII and that the locale is set to "C". The
    f43be0
    + * compiler will also inline these functions, providing an additional
    f43be0
    + * speedup by saving on function calls.
    f43be0
    + */
    f43be0
    +static inline int is_ws_char(char c)
    f43be0
    +{
    f43be0
    +	return c == ' '
    f43be0
    +	    || c == '\t'
    f43be0
    +	    || c == '\n'
    f43be0
    +	    || c == '\r';
    f43be0
    +}
    f43be0
    +
    f43be0
    +static inline int is_hex_char(char c)
    f43be0
    +{
    f43be0
    +	return (c >= '0' && c <= '9')
    f43be0
    +	    || (c >= 'A' && c <= 'F')
    f43be0
    +	    || (c >= 'a' && c <= 'f');
    f43be0
    +}
    f43be0
    +
    f43be0
     /* Use C99 NAN by default; if not available, nan("") should work too. */
    f43be0
     #ifndef NAN
    f43be0
     #define NAN nan("")
    f43be0
     #endif /* !NAN */
    f43be0
     
    f43be0
     static const char json_null_str[] = "null";
    f43be0
     static const int json_null_str_len = sizeof(json_null_str) - 1;
    f43be0
     static const char json_inf_str[] = "Infinity";
    f43be0
    -static const char json_inf_str_lower[] = "infinity";
    f43be0
    +/* Swapped case "Infinity" to avoid need to call tolower() on input chars: */
    f43be0
    +static const char json_inf_str_invert[] = "iNFINITY";
    f43be0
     static const unsigned int json_inf_str_len = sizeof(json_inf_str) - 1;
    f43be0
     static const char json_nan_str[] = "NaN";
    f43be0
     static const int json_nan_str_len = sizeof(json_nan_str) - 1;
    f43be0
     static const char json_true_str[] = "true";
    f43be0
     static const int json_true_str_len = sizeof(json_true_str) - 1;
    f43be0
    @@ -132,10 +160,16 @@ struct json_tokener *json_tokener_new_ex
    f43be0
     	{
    f43be0
     		free(tok);
    f43be0
     		return NULL;
    f43be0
     	}
    f43be0
     	tok->pb = printbuf_new();
    f43be0
    +	if (!tok->pb)
    f43be0
    +	{
    f43be0
    +		free(tok->stack);
    f43be0
    +		free(tok);
    f43be0
    +		return NULL;
    f43be0
    +	}
    f43be0
     	tok->max_depth = depth;
    f43be0
     	json_tokener_reset(tok);
    f43be0
     	return tok;
    f43be0
     }
    f43be0
     
    f43be0
    @@ -314,11 +348,11 @@ struct json_object *json_tokener_parse_e
    f43be0
     		switch (state)
    f43be0
     		{
    f43be0
     
    f43be0
     		case json_tokener_state_eatws:
    f43be0
     			/* Advance until we change state */
    f43be0
    -			while (isspace((unsigned char)c))
    f43be0
    +			while (is_ws_char(c))
    f43be0
     			{
    f43be0
     				if ((!ADVANCE_CHAR(str, tok)) || (!PEEK_CHAR(c, tok)))
    f43be0
     					goto out;
    f43be0
     			}
    f43be0
     			if (c == '/' && !(tok->flags & JSON_TOKENER_STRICT))
    f43be0
    @@ -419,21 +453,19 @@ struct json_object *json_tokener_parse_e
    f43be0
     			 * a character at a time.
    f43be0
     			 * Trying to handle it both ways would make this code considerably more
    f43be0
     			 * complicated with likely little performance benefit.
    f43be0
     			 */
    f43be0
     			int is_negative = 0;
    f43be0
    -			const char *_json_inf_str = json_inf_str;
    f43be0
    -			if (!(tok->flags & JSON_TOKENER_STRICT))
    f43be0
    -				_json_inf_str = json_inf_str_lower;
    f43be0
     
    f43be0
     			/* Note: tok->st_pos must be 0 when state is set to json_tokener_state_inf */
    f43be0
     			while (tok->st_pos < (int)json_inf_str_len)
    f43be0
     			{
    f43be0
     				char inf_char = *str;
    f43be0
    -				if (!(tok->flags & JSON_TOKENER_STRICT))
    f43be0
    -					inf_char = tolower((unsigned char)*str);
    f43be0
    -				if (inf_char != _json_inf_str[tok->st_pos])
    f43be0
    +				if (inf_char != json_inf_str[tok->st_pos] &&
    f43be0
    +				    ((tok->flags & JSON_TOKENER_STRICT) ||
    f43be0
    +				      inf_char != json_inf_str_invert[tok->st_pos])
    f43be0
    +				   )
    f43be0
     				{
    f43be0
     					tok->err = json_tokener_error_parse_unexpected;
    f43be0
     					goto out;
    f43be0
     				}
    f43be0
     				tok->st_pos++;
    f43be0
    @@ -645,11 +677,11 @@ struct json_object *json_tokener_parse_e
    f43be0
     		case json_tokener_state_escape_unicode:
    f43be0
     		{
    f43be0
     			/* Handle a 4-byte \uNNNN sequence, or two sequences if a surrogate pair */
    f43be0
     			while (1)
    f43be0
     			{
    f43be0
    -				if (!c || !strchr(json_hex_chars, c))
    f43be0
    +				if (!c || !is_hex_char(c))
    f43be0
     				{
    f43be0
     					tok->err = json_tokener_error_parse_string;
    f43be0
     					goto out;
    f43be0
     				}
    f43be0
     				tok->ucs_char |=
    f43be0
    @@ -712,11 +744,11 @@ struct json_object *json_tokener_parse_e
    f43be0
     				/*
    f43be0
     				 * The next two characters should be \u, HOWEVER,
    f43be0
     				 * we can't simply peek ahead here, because the
    f43be0
     				 * characters we need might not be passed to us
    f43be0
     				 * until a subsequent call to json_tokener_parse.
    f43be0
    -				 * Instead, transition throug a couple of states.
    f43be0
    +				 * Instead, transition through a couple of states.
    f43be0
     				 * (now):
    f43be0
     				 *   _escape_unicode => _unicode_need_escape
    f43be0
     				 * (see a '\\' char):
    f43be0
     				 *   _unicode_need_escape => _unicode_need_u
    f43be0
     				 * (see a 'u' char):
    f43be0
    @@ -918,11 +950,11 @@ struct json_object *json_tokener_parse_e
    f43be0
     				However, if we're at the top-level, use the number as-is
    f43be0
     			    because c can be part of a new object to parse on the
    f43be0
     				next call to json_tokener_parse().
    f43be0
     			 */
    f43be0
     			if (tok->depth > 0 && c != ',' && c != ']' && c != '}' && c != '/' &&
    f43be0
    -			    c != 'I' && c != 'i' && !isspace((unsigned char)c))
    f43be0
    +			    c != 'I' && c != 'i' && !is_ws_char(c))
    f43be0
     			{
    f43be0
     				tok->err = json_tokener_error_parse_number;
    f43be0
     				goto out;
    f43be0
     			}
    f43be0
     			if (case_len > 0)
    f43be0
    diff --git a/comm/third_party/json-c/json_types.h b/comm/third_party/json-c/json_types.h
    f43be0
    --- a/comm/third_party/json-c/json_types.h
    f43be0
    +++ b/comm/third_party/json-c/json_types.h
    f43be0
    @@ -16,11 +16,11 @@
    f43be0
     #ifdef __cplusplus
    f43be0
     extern "C" {
    f43be0
     #endif
    f43be0
     
    f43be0
     #ifndef JSON_EXPORT
    f43be0
    -#if defined(_MSC_VER)
    f43be0
    +#if defined(_MSC_VER) && defined(JSON_C_DLL)
    f43be0
     #define JSON_EXPORT __declspec(dllexport)
    f43be0
     #else
    f43be0
     #define JSON_EXPORT extern
    f43be0
     #endif
    f43be0
     #endif
    f43be0
    diff --git a/comm/third_party/json-c/json_util.c b/comm/third_party/json-c/json_util.c
    f43be0
    --- a/comm/third_party/json-c/json_util.c
    f43be0
    +++ b/comm/third_party/json-c/json_util.c
    f43be0
    @@ -12,11 +12,10 @@
    f43be0
     #include "config.h"
    f43be0
     #undef realloc
    f43be0
     
    f43be0
     #include "strerror_override.h"
    f43be0
     
    f43be0
    -#include <ctype.h>
    f43be0
     #include <limits.h>
    f43be0
     #include <stdarg.h>
    f43be0
     #include <stddef.h>
    f43be0
     #include <stdio.h>
    f43be0
     #include <stdlib.h>
    f43be0
    @@ -90,21 +89,21 @@ struct json_object *json_object_from_fd_
    f43be0
     	int depth = JSON_TOKENER_DEFAULT_DEPTH;
    f43be0
     	json_tokener *tok;
    f43be0
     
    f43be0
     	if (!(pb = printbuf_new()))
    f43be0
     	{
    f43be0
    -		_json_c_set_last_err("json_object_from_file: printbuf_new failed\n");
    f43be0
    +		_json_c_set_last_err("json_object_from_fd_ex: printbuf_new failed\n");
    f43be0
     		return NULL;
    f43be0
     	}
    f43be0
     
    f43be0
     	if (in_depth != -1)
    f43be0
     		depth = in_depth;
    f43be0
     	tok = json_tokener_new_ex(depth);
    f43be0
     	if (!tok)
    f43be0
     	{
    f43be0
     		_json_c_set_last_err(
    f43be0
    -		    "json_object_from_fd: unable to allocate json_tokener(depth=%d): %s\n", depth,
    f43be0
    +		    "json_object_from_fd_ex: unable to allocate json_tokener(depth=%d): %s\n", depth,
    f43be0
     		    strerror(errno));
    f43be0
     		printbuf_free(pb);
    f43be0
     		return NULL;
    f43be0
     	}
    f43be0
     
    f43be0
    @@ -112,11 +111,11 @@ struct json_object *json_object_from_fd_
    f43be0
     	{
    f43be0
     		printbuf_memappend(pb, buf, ret);
    f43be0
     	}
    f43be0
     	if (ret < 0)
    f43be0
     	{
    f43be0
    -		_json_c_set_last_err("json_object_from_fd: error reading fd %d: %s\n", fd,
    f43be0
    +		_json_c_set_last_err("json_object_from_fd_ex: error reading fd %d: %s\n", fd,
    f43be0
     		                     strerror(errno));
    f43be0
     		json_tokener_free(tok);
    f43be0
     		printbuf_free(pb);
    f43be0
     		return NULL;
    f43be0
     	}
    f43be0
    @@ -136,12 +135,12 @@ struct json_object *json_object_from_fil
    f43be0
     	struct json_object *obj;
    f43be0
     	int fd;
    f43be0
     
    f43be0
     	if ((fd = open(filename, O_RDONLY)) < 0)
    f43be0
     	{
    f43be0
    -		_json_c_set_last_err("json_object_from_file: error opening file %s: %s\n", filename,
    f43be0
    -		                     strerror(errno));
    f43be0
    +		_json_c_set_last_err("json_object_from_file: error opening file %s: %s\n",
    f43be0
    +		                     filename, strerror(errno));
    f43be0
     		return NULL;
    f43be0
     	}
    f43be0
     	obj = json_object_from_fd(fd);
    f43be0
     	close(fd);
    f43be0
     	return obj;
    f43be0
    @@ -154,18 +153,18 @@ int json_object_to_file_ext(const char *
    f43be0
     	int fd, ret;
    f43be0
     	int saved_errno;
    f43be0
     
    f43be0
     	if (!obj)
    f43be0
     	{
    f43be0
    -		_json_c_set_last_err("json_object_to_file: object is null\n");
    f43be0
    +		_json_c_set_last_err("json_object_to_file_ext: object is null\n");
    f43be0
     		return -1;
    f43be0
     	}
    f43be0
     
    f43be0
     	if ((fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0)
    f43be0
     	{
    f43be0
    -		_json_c_set_last_err("json_object_to_file: error opening file %s: %s\n", filename,
    f43be0
    -		                     strerror(errno));
    f43be0
    +		_json_c_set_last_err("json_object_to_file_ext: error opening file %s: %s\n",
    f43be0
    +		                     filename, strerror(errno));
    f43be0
     		return -1;
    f43be0
     	}
    f43be0
     	ret = _json_object_to_fd(fd, obj, flags, filename);
    f43be0
     	saved_errno = errno;
    f43be0
     	close(fd);
    f43be0
    @@ -201,11 +200,11 @@ static int _json_object_to_fd(int fd, st
    f43be0
     	wpos = 0;
    f43be0
     	while (wpos < wsize)
    f43be0
     	{
    f43be0
     		if ((ret = write(fd, json_str + wpos, wsize - wpos)) < 0)
    f43be0
     		{
    f43be0
    -			_json_c_set_last_err("json_object_to_file: error writing file %s: %s\n",
    f43be0
    +			_json_c_set_last_err("json_object_to_fd: error writing file %s: %s\n",
    f43be0
     			                     filename, strerror(errno));
    f43be0
     			return -1;
    f43be0
     		}
    f43be0
     
    f43be0
     		/* because of the above check for ret < 0, we can safely cast and add */
    f43be0
    @@ -287,11 +286,11 @@ static const char *json_type_name[] = {
    f43be0
     const char *json_type_to_name(enum json_type o_type)
    f43be0
     {
    f43be0
     	int o_type_int = (int)o_type;
    f43be0
     	if (o_type_int < 0 || o_type_int >= (int)NELEM(json_type_name))
    f43be0
     	{
    f43be0
    -		_json_c_set_last_err("json_type_to_name: type %d is out of range [0,%d]\n", o_type,
    f43be0
    -		                     NELEM(json_type_name));
    f43be0
    +		_json_c_set_last_err("json_type_to_name: type %d is out of range [0,%u]\n", o_type,
    f43be0
    +		                     (unsigned)NELEM(json_type_name));
    f43be0
     		return NULL;
    f43be0
     	}
    f43be0
     	return json_type_name[o_type];
    f43be0
     }
    f43be0
    diff --git a/comm/third_party/json-c/linkhash.c b/comm/third_party/json-c/linkhash.c
    f43be0
    --- a/comm/third_party/json-c/linkhash.c
    f43be0
    +++ b/comm/third_party/json-c/linkhash.c
    f43be0
    @@ -63,13 +63,13 @@ int lh_ptr_equal(const void *k1, const v
    f43be0
     	return (k1 == k2);
    f43be0
     }
    f43be0
     
    f43be0
     /*
    f43be0
      * hashlittle from lookup3.c, by Bob Jenkins, May 2006, Public Domain.
    f43be0
    - * http://burtleburtle.net/bob/c/lookup3.c
    f43be0
    + * https://burtleburtle.net/bob/c/lookup3.c
    f43be0
      * minor modifications to make functions static so no symbols are exported
    f43be0
    - * minor mofifications to compile with -Werror
    f43be0
    + * minor modifications to compile with -Werror
    f43be0
      */
    f43be0
     
    f43be0
     /*
    f43be0
     -------------------------------------------------------------------------------
    f43be0
     lookup3.c, by Bob Jenkins, May 2006, Public Domain.
    f43be0
    @@ -79,11 +79,11 @@ hashword(), hashlittle(), hashlittle2(),
    f43be0
     are externally useful functions.  Routines to test the hash are included
    f43be0
     if SELF_TEST is defined.  You can use this free for any purpose.  It's in
    f43be0
     the public domain.  It has no warranty.
    f43be0
     
    f43be0
     You probably want to use hashlittle().  hashlittle() and hashbig()
    f43be0
    -hash byte arrays.  hashlittle() is is faster than hashbig() on
    f43be0
    +hash byte arrays.  hashlittle() is faster than hashbig() on
    f43be0
     little-endian machines.  Intel and AMD are little-endian machines.
    f43be0
     On second thought, you probably want hashlittle2(), which is identical to
    f43be0
     hashlittle() except it returns two 32-bit hashes for the price of one.
    f43be0
     You could implement hashbig2() if you wanted but I haven't bothered here.
    f43be0
     
    f43be0
    @@ -154,11 +154,11 @@ satisfy this are
    f43be0
         4  6  8 16 19  4
    f43be0
         9 15  3 18 27 15
    f43be0
        14  9  3  7 17  3
    f43be0
     Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
    f43be0
     for "differ" defined as + with a one-bit base and a two-bit delta.  I
    f43be0
    -used http://burtleburtle.net/bob/hash/avalanche.html to choose
    f43be0
    +used https://burtleburtle.net/bob/hash/avalanche.html to choose
    f43be0
     the operations, constants, and arrangements of the variables.
    f43be0
     
    f43be0
     This does not achieve avalanche.  There are input bits of (a,b,c)
    f43be0
     that fail to affect some output bits of (a,b,c), especially of a.  The
    f43be0
     most thoroughly mixed value is c, but it doesn't really even achieve
    f43be0
    @@ -283,13 +283,13 @@ static uint32_t hashlittle(const void *k
    f43be0
     		 * then masks off the part it's not allowed to read.  Because the
    f43be0
     		 * string is aligned, the masked-off tail is in the same word as the
    f43be0
     		 * rest of the string.  Every machine with memory protection I've seen
    f43be0
     		 * does it on word boundaries, so is OK with this.  But VALGRIND will
    f43be0
     		 * still catch it and complain.  The masking trick does make the hash
    f43be0
    -		 * noticably faster for short strings (like English words).
    f43be0
    +		 * noticeably faster for short strings (like English words).
    f43be0
     		 * AddressSanitizer is similarly picky about overrunning
    f43be0
    -		 * the buffer. (http://clang.llvm.org/docs/AddressSanitizer.html
    f43be0
    +		 * the buffer. (https://clang.llvm.org/docs/AddressSanitizer.html)
    f43be0
     		 */
    f43be0
     #ifdef VALGRIND
    f43be0
     #define PRECISE_MEMORY_ACCESS 1
    f43be0
     #elif defined(__SANITIZE_ADDRESS__) /* GCC's ASAN */
    f43be0
     #define PRECISE_MEMORY_ACCESS 1
    f43be0
    @@ -437,12 +437,12 @@ static uint32_t hashlittle(const void *k
    f43be0
     	final(a,b,c);
    f43be0
     	return c;
    f43be0
     }
    f43be0
     /* clang-format on */
    f43be0
     
    f43be0
    -/* a simple hash function similiar to what perl does for strings.
    f43be0
    - * for good results, the string should not be excessivly large.
    f43be0
    +/* a simple hash function similar to what perl does for strings.
    f43be0
    + * for good results, the string should not be excessively large.
    f43be0
      */
    f43be0
     static unsigned long lh_perllike_str_hash(const void *k)
    f43be0
     {
    f43be0
     	const char *rkey = (const char *)k;
    f43be0
     	unsigned hashval = 1;
    f43be0
    @@ -463,11 +463,11 @@ static unsigned long lh_char_hash(const 
    f43be0
     	static volatile RANDOM_SEED_TYPE random_seed = -1;
    f43be0
     
    f43be0
     	if (random_seed == -1)
    f43be0
     	{
    f43be0
     		RANDOM_SEED_TYPE seed;
    f43be0
    -		/* we can't use -1 as it is the unitialized sentinel */
    f43be0
    +		/* we can't use -1 as it is the uninitialized sentinel */
    f43be0
     		while ((seed = json_c_get_random_seed()) == -1) {}
    f43be0
     #if SIZEOF_INT == 8 && defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
    f43be0
     #define USE_SYNC_COMPARE_AND_SWAP 1
    f43be0
     #endif
    f43be0
     #if SIZEOF_INT == 4 && defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
    f43be0
    @@ -479,16 +479,16 @@ static unsigned long lh_char_hash(const 
    f43be0
     #if defined USE_SYNC_COMPARE_AND_SWAP
    f43be0
     		(void)__sync_val_compare_and_swap(&random_seed, -1, seed);
    f43be0
     #elif defined _MSC_VER || defined __MINGW32__
    f43be0
     		InterlockedCompareExchange(&random_seed, seed, -1);
    f43be0
     #else
    f43be0
    -		//#warning "racy random seed initializtion if used by multiple threads"
    f43be0
    +		//#warning "racy random seed initialization if used by multiple threads"
    f43be0
     		random_seed = seed; /* potentially racy */
    f43be0
     #endif
    f43be0
     	}
    f43be0
     
    f43be0
    -	return hashlittle((const char *)k, strlen((const char *)k), random_seed);
    f43be0
    +	return hashlittle((const char *)k, strlen((const char *)k), (uint32_t)random_seed);
    f43be0
     }
    f43be0
     
    f43be0
     int lh_char_equal(const void *k1, const void *k2)
    f43be0
     {
    f43be0
     	return (strcmp((const char *)k1, (const char *)k2) == 0);
    f43be0
    @@ -544,11 +544,11 @@ int lh_table_resize(struct lh_table *t, 
    f43be0
     	for (ent = t->head; ent != NULL; ent = ent->next)
    f43be0
     	{
    f43be0
     		unsigned long h = lh_get_hash(new_t, ent->k);
    f43be0
     		unsigned int opts = 0;
    f43be0
     		if (ent->k_is_constant)
    f43be0
    -			opts = JSON_C_OBJECT_KEY_IS_CONSTANT;
    f43be0
    +			opts = JSON_C_OBJECT_ADD_CONSTANT_KEY;
    f43be0
     		if (lh_table_insert_w_hash(new_t, ent->k, ent->v, h, opts) != 0)
    f43be0
     		{
    f43be0
     			lh_table_free(new_t);
    f43be0
     			return -1;
    f43be0
     		}
    f43be0
    @@ -597,11 +597,11 @@ int lh_table_insert_w_hash(struct lh_tab
    f43be0
     		if ((int)++n == t->size)
    f43be0
     			n = 0;
    f43be0
     	}
    f43be0
     
    f43be0
     	t->table[n].k = k;
    f43be0
    -	t->table[n].k_is_constant = (opts & JSON_C_OBJECT_KEY_IS_CONSTANT);
    f43be0
    +	t->table[n].k_is_constant = (opts & JSON_C_OBJECT_ADD_CONSTANT_KEY);
    f43be0
     	t->table[n].v = v;
    f43be0
     	t->count++;
    f43be0
     
    f43be0
     	if (t->head == NULL)
    f43be0
     	{
    f43be0
    diff --git a/comm/third_party/json-c/linkhash.h b/comm/third_party/json-c/linkhash.h
    f43be0
    --- a/comm/third_party/json-c/linkhash.h
    f43be0
    +++ b/comm/third_party/json-c/linkhash.h
    f43be0
    @@ -14,12 +14,12 @@
    f43be0
      * @file
    f43be0
      * @brief Internal methods for working with json_type_object objects.  Although
    f43be0
      *        this is exposed by the json_object_get_object() function and within the
    f43be0
      *        json_object_iter type, it is not recommended for direct use.
    f43be0
      */
    f43be0
    -#ifndef _linkhash_h_
    f43be0
    -#define _linkhash_h_
    f43be0
    +#ifndef _json_c_linkhash_h_
    f43be0
    +#define _json_c_linkhash_h_
    f43be0
     
    f43be0
     #include "json_object.h"
    f43be0
     
    f43be0
     #ifdef __cplusplus
    f43be0
     extern "C" {
    f43be0
    @@ -78,86 +78,106 @@ typedef unsigned long(lh_hash_fn)(const 
    f43be0
      * callback function prototypes
    f43be0
      */
    f43be0
     typedef int(lh_equal_fn)(const void *k1, const void *k2);
    f43be0
     
    f43be0
     /**
    f43be0
    - * An entry in the hash table
    f43be0
    + * An entry in the hash table.  Outside of linkhash.c, treat this as opaque.
    f43be0
      */
    f43be0
     struct lh_entry
    f43be0
     {
    f43be0
     	/**
    f43be0
    -	 * The key.  Use lh_entry_k() instead of accessing this directly.
    f43be0
    +	 * The key.
    f43be0
    +	 * @deprecated Use lh_entry_k() instead of accessing this directly.
    f43be0
     	 */
    f43be0
     	const void *k;
    f43be0
     	/**
    f43be0
     	 * A flag for users of linkhash to know whether or not they
    f43be0
     	 * need to free k.
    f43be0
    +	 * @deprecated use lh_entry_k_is_constant() instead.
    f43be0
     	 */
    f43be0
     	int k_is_constant;
    f43be0
     	/**
    f43be0
    -	 * The value.  Use lh_entry_v() instead of accessing this directly.
    f43be0
    +	 * The value.
    f43be0
    +	 * @deprecated Use lh_entry_v() instead of accessing this directly.
    f43be0
     	 */
    f43be0
     	const void *v;
    f43be0
     	/**
    f43be0
    -	 * The next entry
    f43be0
    +	 * The next entry.
    f43be0
    +	 * @deprecated Use lh_entry_next() instead of accessing this directly.
    f43be0
     	 */
    f43be0
     	struct lh_entry *next;
    f43be0
     	/**
    f43be0
     	 * The previous entry.
    f43be0
    +	 * @deprecated Use lh_entry_prev() instead of accessing this directly.
    f43be0
     	 */
    f43be0
     	struct lh_entry *prev;
    f43be0
     };
    f43be0
     
    f43be0
     /**
    f43be0
    - * The hash table structure.
    f43be0
    + * The hash table structure.  Outside of linkhash.c, treat this as opaque.
    f43be0
      */
    f43be0
     struct lh_table
    f43be0
     {
    f43be0
     	/**
    f43be0
     	 * Size of our hash.
    f43be0
    +	 * @deprecated do not use outside of linkhash.c
    f43be0
     	 */
    f43be0
     	int size;
    f43be0
     	/**
    f43be0
     	 * Numbers of entries.
    f43be0
    +	 * @deprecated Use lh_table_length() instead.
    f43be0
     	 */
    f43be0
     	int count;
    f43be0
     
    f43be0
     	/**
    f43be0
     	 * The first entry.
    f43be0
    +	 * @deprecated Use lh_table_head() instead.
    f43be0
     	 */
    f43be0
     	struct lh_entry *head;
    f43be0
     
    f43be0
     	/**
    f43be0
     	 * The last entry.
    f43be0
    +	 * @deprecated Do not use, may be removed in a future release.
    f43be0
     	 */
    f43be0
     	struct lh_entry *tail;
    f43be0
     
    f43be0
    +	/**
    f43be0
    +	 * Internal storage of the actual table of entries.
    f43be0
    +	 * @deprecated do not use outside of linkhash.c
    f43be0
    +	 */
    f43be0
     	struct lh_entry *table;
    f43be0
     
    f43be0
     	/**
    f43be0
    -	 * A pointer onto the function responsible for freeing an entry.
    f43be0
    +	 * A pointer to the function responsible for freeing an entry.
    f43be0
    +	 * @deprecated do not use outside of linkhash.c
    f43be0
     	 */
    f43be0
     	lh_entry_free_fn *free_fn;
    f43be0
    +	/**
    f43be0
    +	 * @deprecated do not use outside of linkhash.c
    f43be0
    +	 */
    f43be0
     	lh_hash_fn *hash_fn;
    f43be0
    +	/**
    f43be0
    +	 * @deprecated do not use outside of linkhash.c
    f43be0
    +	 */
    f43be0
     	lh_equal_fn *equal_fn;
    f43be0
     };
    f43be0
     typedef struct lh_table lh_table;
    f43be0
     
    f43be0
     /**
    f43be0
      * Convenience list iterator.
    f43be0
      */
    f43be0
    -#define lh_foreach(table, entry) for (entry = table->head; entry; entry = entry->next)
    f43be0
    +#define lh_foreach(table, entry) for (entry = lh_table_head(table); entry; entry = lh_entry_next(entry))
    f43be0
     
    f43be0
     /**
    f43be0
      * lh_foreach_safe allows calling of deletion routine while iterating.
    f43be0
      *
    f43be0
      * @param table a struct lh_table * to iterate over
    f43be0
      * @param entry a struct lh_entry * variable to hold each element
    f43be0
      * @param tmp a struct lh_entry * variable to hold a temporary pointer to the next element
    f43be0
      */
    f43be0
     #define lh_foreach_safe(table, entry, tmp) \
    f43be0
    -	for (entry = table->head; entry && ((tmp = entry->next) || 1); entry = tmp)
    f43be0
    +	for (entry = lh_table_head(table); entry && ((tmp = lh_entry_next(entry)) || 1); entry = tmp)
    f43be0
     
    f43be0
     /**
    f43be0
      * Create a new linkhash table.
    f43be0
      *
    f43be0
      * @param size initial table size. The table is automatically resized
    f43be0
    @@ -229,11 +249,11 @@ extern int lh_table_insert(struct lh_tab
    f43be0
      *
    f43be0
      * @param t the table to insert into.
    f43be0
      * @param k a pointer to the key to insert.
    f43be0
      * @param v a pointer to the value to insert.
    f43be0
      * @param h hash value of the key to insert
    f43be0
    - * @param opts if set to JSON_C_OBJECT_KEY_IS_CONSTANT, sets lh_entry.k_is_constant
    f43be0
    + * @param opts if set to JSON_C_OBJECT_ADD_CONSTANT_KEY, sets lh_entry.k_is_constant
    f43be0
      *             so t's free function knows to avoid freeing the key.
    f43be0
      */
    f43be0
     extern int lh_table_insert_w_hash(struct lh_table *t, const void *k, const void *v,
    f43be0
                                       const unsigned long h, const unsigned opts);
    f43be0
     
    f43be0
    @@ -293,10 +313,13 @@ extern int lh_table_delete_entry(struct 
    f43be0
      * @return 0 if the item was deleted.
    f43be0
      * @return -1 if it was not found.
    f43be0
      */
    f43be0
     extern int lh_table_delete(struct lh_table *t, const void *k);
    f43be0
     
    f43be0
    +/**
    f43be0
    + * Return the number of entries in the table.
    f43be0
    + */
    f43be0
     extern int lh_table_length(struct lh_table *t);
    f43be0
     
    f43be0
     /**
    f43be0
      * Resizes the specified table.
    f43be0
      *
    f43be0
    @@ -317,13 +340,22 @@ int lh_table_resize(struct lh_table *t, 
    f43be0
     #else
    f43be0
     #define _LH_INLINE inline
    f43be0
     #endif
    f43be0
     
    f43be0
     /**
    f43be0
    + * Return the first entry in the lh_table.
    f43be0
    + * @see lh_entry_next()
    f43be0
    + */
    f43be0
    +static _LH_INLINE struct lh_entry *lh_table_head(const lh_table *t)
    f43be0
    +{
    f43be0
    +	return t->head;
    f43be0
    +}
    f43be0
    +
    f43be0
    +/**
    f43be0
      * Calculate the hash of a key for a given table.
    f43be0
      *
    f43be0
    - * This is an exension to support functions that need to calculate
    f43be0
    + * This is an extension to support functions that need to calculate
    f43be0
      * the hash several times and allows them to do it just once and then pass
    f43be0
      * in the hash to all utility functions. Depending on use case, this can be a
    f43be0
      * considerable performance improvement.
    f43be0
      * @param t the table (used to obtain hash function)
    f43be0
      * @param k a pointer to the key to lookup
    f43be0
    @@ -332,11 +364,10 @@ int lh_table_resize(struct lh_table *t, 
    f43be0
     static _LH_INLINE unsigned long lh_get_hash(const struct lh_table *t, const void *k)
    f43be0
     {
    f43be0
     	return t->hash_fn(k);
    f43be0
     }
    f43be0
     
    f43be0
    -#undef _LH_INLINE
    f43be0
     
    f43be0
     /**
    f43be0
      * @deprecated Don't use this outside of linkhash.h:
    f43be0
      */
    f43be0
     #ifdef __UNCONST
    f43be0
    @@ -348,21 +379,68 @@ static _LH_INLINE unsigned long lh_get_h
    f43be0
     /**
    f43be0
      * Return a non-const version of lh_entry.k.
    f43be0
      *
    f43be0
      * lh_entry.k is const to indicate and help ensure that linkhash itself doesn't modify
    f43be0
      * it, but callers are allowed to do what they want with it.
    f43be0
    - * See also lh_entry.k_is_constant
    f43be0
    + * @see lh_entry_k_is_constant()
    f43be0
      */
    f43be0
    -#define lh_entry_k(entry) _LH_UNCONST((entry)->k)
    f43be0
    +static _LH_INLINE void *lh_entry_k(const struct lh_entry *e)
    f43be0
    +{
    f43be0
    +	return _LH_UNCONST(e->k);
    f43be0
    +}
    f43be0
    +
    f43be0
    +/**
    f43be0
    + * Returns 1 if the key for the given entry is constant, and thus
    f43be0
    + *  does not need to be freed when the lh_entry is freed.
    f43be0
    + * @see lh_table_insert_w_hash()
    f43be0
    + */
    f43be0
    +static _LH_INLINE int lh_entry_k_is_constant(const struct lh_entry *e)
    f43be0
    +{
    f43be0
    +	return e->k_is_constant;
    f43be0
    +}
    f43be0
     
    f43be0
     /**
    f43be0
      * Return a non-const version of lh_entry.v.
    f43be0
      *
    f43be0
      * v is const to indicate and help ensure that linkhash itself doesn't modify
    f43be0
      * it, but callers are allowed to do what they want with it.
    f43be0
      */
    f43be0
    -#define lh_entry_v(entry) _LH_UNCONST((entry)->v)
    f43be0
    +static _LH_INLINE void *lh_entry_v(const struct lh_entry *e)
    f43be0
    +{
    f43be0
    +	return _LH_UNCONST(e->v);
    f43be0
    +}
    f43be0
    +
    f43be0
    +/**
    f43be0
    + * Change the value for an entry.  The caller is responsible for freeing
    f43be0
    + *  the previous value.
    f43be0
    + */
    f43be0
    +static _LH_INLINE void lh_entry_set_val(struct lh_entry *e, void *newval)
    f43be0
    +{
    f43be0
    +	e->v = newval;
    f43be0
    +}
    f43be0
    +
    f43be0
    +/**
    f43be0
    + * Return the next element, or NULL if there is no next element.
    f43be0
    + * @see lh_table_head()
    f43be0
    + * @see lh_entry_prev()
    f43be0
    + */
    f43be0
    +static _LH_INLINE struct lh_entry *lh_entry_next(const struct lh_entry *e)
    f43be0
    +{
    f43be0
    +	return e->next;
    f43be0
    +}
    f43be0
    +
    f43be0
    +/**
    f43be0
    + * Return the previous element, or NULL if there is no previous element.
    f43be0
    + * @see lh_table_head()
    f43be0
    + * @see lh_entry_next()
    f43be0
    + */
    f43be0
    +static _LH_INLINE struct lh_entry *lh_entry_prev(const struct lh_entry *e)
    f43be0
    +{
    f43be0
    +	return e->prev;
    f43be0
    +}
    f43be0
    +
    f43be0
    +#undef _LH_INLINE
    f43be0
     
    f43be0
     #ifdef __cplusplus
    f43be0
     }
    f43be0
     #endif
    f43be0
     
    f43be0
    diff --git a/comm/third_party/json-c/moz.build b/third_party/json-c/moz.b/commuild
    f43be0
    --- a/comm/third_party/json-c/moz.build
    f43be0
    +++ b/comm/third_party/json-c/moz.build
    f43be0
    @@ -21,10 +21,22 @@ else:
    f43be0
         DEFINES["_GNU_SOURCE"] = True
    f43be0
         DEFINES["CC"] = CONFIG["_CC"]
    f43be0
     
    f43be0
         CONFIGURE_DEFINE_FILES += ["config.h", "json_config.h"]
    f43be0
     
    f43be0
    +    GeneratedFile(
    f43be0
    +        "json.h",
    f43be0
    +        script="/python/mozbuild/mozbuild/action/preprocessor.py",
    f43be0
    +        entry_point="generate",
    f43be0
    +        inputs=["json.h.cmakein"],
    f43be0
    +        flags=[
    f43be0
    +            "--marker", "%",
    f43be0
    +            "-F", "substitution",
    f43be0
    +            "-DJSON_H_JSON_POINTER=#include \"json_pointer.h\""
    f43be0
    +        ]
    f43be0
    +    )
    f43be0
    +
    f43be0
         SOURCES += [
    f43be0
             "arraylist.c",
    f43be0
             "debug.c",
    f43be0
             "json_c_version.c",
    f43be0
             "json_object.c",
    f43be0
    diff --git a/comm/third_party/json-c/printbuf.c b/third_party/json-c/printb/commuf.c
    f43be0
    --- a/comm/third_party/json-c/printbuf.c
    f43be0
    +++ b/comm/third_party/json-c/printbuf.c
    f43be0
    @@ -8,11 +8,11 @@
    f43be0
      * it under the terms of the MIT license. See COPYING for details.
    f43be0
      *
    f43be0
      *
    f43be0
      * Copyright (c) 2008-2009 Yahoo! Inc.  All rights reserved.
    f43be0
      * The copyrights to the contents of this file are licensed under the MIT License
    f43be0
    - * (http://www.opensource.org/licenses/mit-license.php)
    f43be0
    + * (https://www.opensource.org/licenses/mit-license.php)
    f43be0
      */
    f43be0
     
    f43be0
     #include "config.h"
    f43be0
     
    f43be0
     #include <limits.h>
    f43be0
    @@ -89,11 +89,11 @@ static int printbuf_extend(struct printb
    f43be0
     }
    f43be0
     
    f43be0
     int printbuf_memappend(struct printbuf *p, const char *buf, int size)
    f43be0
     {
    f43be0
     	/* Prevent signed integer overflows with large buffers. */
    f43be0
    -	if (size > INT_MAX - p->bpos - 1)
    f43be0
    +	if (size < 0 || size > INT_MAX - p->bpos - 1)
    f43be0
     		return -1;
    f43be0
     	if (p->size <= p->bpos + size + 1)
    f43be0
     	{
    f43be0
     		if (printbuf_extend(p, p->bpos + size + 1) < 0)
    f43be0
     			return -1;
    f43be0
    @@ -109,19 +109,21 @@ int printbuf_memset(struct printbuf *pb,
    f43be0
     	int size_needed;
    f43be0
     
    f43be0
     	if (offset == -1)
    f43be0
     		offset = pb->bpos;
    f43be0
     	/* Prevent signed integer overflows with large buffers. */
    f43be0
    -	if (len > INT_MAX - offset)
    f43be0
    +	if (len < 0 || offset < -1 || len > INT_MAX - offset)
    f43be0
     		return -1;
    f43be0
     	size_needed = offset + len;
    f43be0
     	if (pb->size < size_needed)
    f43be0
     	{
    f43be0
     		if (printbuf_extend(pb, size_needed) < 0)
    f43be0
     			return -1;
    f43be0
     	}
    f43be0
     
    f43be0
    +	if (pb->bpos < offset)
    f43be0
    +		memset(pb->buf + pb->bpos, '\0', offset - pb->bpos);
    f43be0
     	memset(pb->buf + offset, charvalue, len);
    f43be0
     	if (pb->bpos < size_needed)
    f43be0
     		pb->bpos = size_needed;
    f43be0
     
    f43be0
     	return 0;
    f43be0
    @@ -132,37 +134,36 @@ int sprintbuf(struct printbuf *p, const 
    f43be0
     	va_list ap;
    f43be0
     	char *t;
    f43be0
     	int size;
    f43be0
     	char buf[128];
    f43be0
     
    f43be0
    -	/* user stack buffer first */
    f43be0
    +	/* use stack buffer first */
    f43be0
     	va_start(ap, msg);
    f43be0
     	size = vsnprintf(buf, 128, msg, ap);
    f43be0
     	va_end(ap);
    f43be0
     	/* if string is greater than stack buffer, then use dynamic string
    f43be0
    -	 * with vasprintf.  Note: some implementation of vsnprintf return -1
    f43be0
    +	 * with vasprintf.  Note: some implementations of vsnprintf return -1
    f43be0
     	 * if output is truncated whereas some return the number of bytes that
    f43be0
     	 * would have been written - this code handles both cases.
    f43be0
     	 */
    f43be0
    -	if (size == -1 || size > 127)
    f43be0
    +	if (size < 0 || size > 127)
    f43be0
     	{
    f43be0
     		va_start(ap, msg);
    f43be0
     		if ((size = vasprintf(&t, msg, ap)) < 0)
    f43be0
     		{
    f43be0
     			va_end(ap);
    f43be0
     			return -1;
    f43be0
     		}
    f43be0
     		va_end(ap);
    f43be0
    -		printbuf_memappend(p, t, size);
    f43be0
    +		size = printbuf_memappend(p, t, size);
    f43be0
     		free(t);
    f43be0
    -		return size;
    f43be0
     	}
    f43be0
     	else
    f43be0
     	{
    f43be0
    -		printbuf_memappend(p, buf, size);
    f43be0
    -		return size;
    f43be0
    +		size = printbuf_memappend(p, buf, size);
    f43be0
     	}
    f43be0
    +	return size;
    f43be0
     }
    f43be0
     
    f43be0
     void printbuf_reset(struct printbuf *p)
    f43be0
     {
    f43be0
     	p->buf[0] = '\0';
    f43be0
    diff --git a/comm/third_party/json-c/printbuf.h b/third_party/json-c/printb/commuf.h
    f43be0
    --- a/comm/third_party/json-c/printbuf.h
    f43be0
    +++ b/comm/third_party/json-c/printbuf.h
    f43be0
    @@ -8,25 +8,25 @@
    f43be0
      * it under the terms of the MIT license. See COPYING for details.
    f43be0
      *
    f43be0
      *
    f43be0
      * Copyright (c) 2008-2009 Yahoo! Inc.  All rights reserved.
    f43be0
      * The copyrights to the contents of this file are licensed under the MIT License
    f43be0
    - * (http://www.opensource.org/licenses/mit-license.php)
    f43be0
    + * (https://www.opensource.org/licenses/mit-license.php)
    f43be0
      */
    f43be0
     
    f43be0
     /**
    f43be0
      * @file
    f43be0
    - * @brief Internal string buffer handing.  Unless you're writing a
    f43be0
    + * @brief Internal string buffer handling.  Unless you're writing a
    f43be0
      *        json_object_to_json_string_fn implementation for use with
    f43be0
      *        json_object_set_serializer() direct use of this is not
    f43be0
      *        recommended.
    f43be0
      */
    f43be0
    -#ifndef _printbuf_h_
    f43be0
    -#define _printbuf_h_
    f43be0
    +#ifndef _json_c_printbuf_h_
    f43be0
    +#define _json_c_printbuf_h_
    f43be0
     
    f43be0
     #ifndef JSON_EXPORT
    f43be0
    -#if defined(_MSC_VER)
    f43be0
    +#if defined(_MSC_VER) && defined(JSON_C_DLL)
    f43be0
     #define JSON_EXPORT __declspec(dllexport)
    f43be0
     #else
    f43be0
     #define JSON_EXPORT extern
    f43be0
     #endif
    f43be0
     #endif
    f43be0
    diff --git a/comm/third_party/json-c/random_seed.c b/comm/third_party/json-c/random_seed.c
    f43be0
    --- a/comm/third_party/json-c/random_seed.c
    f43be0
    +++ b/comm/third_party/json-c/random_seed.c
    f43be0
    @@ -11,13 +11,27 @@
    f43be0
     
    f43be0
     #include "random_seed.h"
    f43be0
     #include "config.h"
    f43be0
     #include "strerror_override.h"
    f43be0
     #include <stdio.h>
    f43be0
    +#include <stdlib.h>
    f43be0
    +#ifdef HAVE_BSD_STDLIB_H
    f43be0
    +#include <bsd/stdlib.h>
    f43be0
    +#endif
    f43be0
     
    f43be0
     #define DEBUG_SEED(s)
    f43be0
     
    f43be0
    +#if defined(__APPLE__) || defined(__unix__) || defined(__linux__)
    f43be0
    +#define HAVE_DEV_RANDOM 1
    f43be0
    +#endif
    f43be0
    +
    f43be0
    +#ifdef HAVE_ARC4RANDOM
    f43be0
    +#undef HAVE_GETRANDOM
    f43be0
    +#undef HAVE_DEV_RANDOM
    f43be0
    +#undef HAVE_CRYPTGENRANDOM
    f43be0
    +#endif
    f43be0
    +
    f43be0
     #if defined ENABLE_RDRAND
    f43be0
     
    f43be0
     /* cpuid */
    f43be0
     
    f43be0
     #if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
    f43be0
    @@ -153,59 +167,88 @@ retry:
    f43be0
     #endif
    f43be0
     #endif
    f43be0
     
    f43be0
     #endif /* defined ENABLE_RDRAND */
    f43be0
     
    f43be0
    -/* has_dev_urandom */
    f43be0
    +#ifdef HAVE_GETRANDOM
    f43be0
    +
    f43be0
    +#include <stdlib.h>
    f43be0
    +#ifdef HAVE_SYS_RANDOM_H
    f43be0
    +#include <sys/random.h>
    f43be0
    +#endif
    f43be0
    +
    f43be0
    +static int get_getrandom_seed(int *seed)
    f43be0
    +{
    f43be0
    +	DEBUG_SEED("get_getrandom_seed");
    f43be0
    +
    f43be0
    +	ssize_t ret;
    f43be0
    +
    f43be0
    +	do
    f43be0
    +	{
    f43be0
    +		ret = getrandom(seed, sizeof(*seed), GRND_NONBLOCK);
    f43be0
    +	} while ((ret == -1) && (errno == EINTR));
    f43be0
     
    f43be0
    -#if defined(__APPLE__) || defined(__unix__) || defined(__linux__)
    f43be0
    +	if (ret == -1)
    f43be0
    +	{
    f43be0
    +		if (errno == ENOSYS) /* syscall not available in kernel */
    f43be0
    +			return -1;
    f43be0
    +		if (errno == EAGAIN) /* entropy not yet initialized */
    f43be0
    +			return -1;
    f43be0
    +
    f43be0
    +		fprintf(stderr, "error from getrandom(): %s", strerror(errno));
    f43be0
    +		return -1;
    f43be0
    +	}
    f43be0
    +
    f43be0
    +	if (ret != sizeof(*seed))
    f43be0
    +		return -1;
    f43be0
    +
    f43be0
    +	return 0;
    f43be0
    +}
    f43be0
    +#endif /* defined HAVE_GETRANDOM */
    f43be0
    +
    f43be0
    +/* get_dev_random_seed */
    f43be0
    +
    f43be0
    +#ifdef HAVE_DEV_RANDOM
    f43be0
     
    f43be0
     #include <fcntl.h>
    f43be0
     #include <string.h>
    f43be0
     #if HAVE_UNISTD_H
    f43be0
     #include <unistd.h>
    f43be0
     #endif /* HAVE_UNISTD_H */
    f43be0
     #include <stdlib.h>
    f43be0
     #include <sys/stat.h>
    f43be0
     
    f43be0
    -#define HAVE_DEV_RANDOM 1
    f43be0
    -
    f43be0
     static const char *dev_random_file = "/dev/urandom";
    f43be0
     
    f43be0
    -static int has_dev_urandom(void)
    f43be0
    +static int get_dev_random_seed(int *seed)
    f43be0
     {
    f43be0
    +	DEBUG_SEED("get_dev_random_seed");
    f43be0
    +
    f43be0
     	struct stat buf;
    f43be0
     	if (stat(dev_random_file, &buf))
    f43be0
    -	{
    f43be0
    -		return 0;
    f43be0
    -	}
    f43be0
    -	return ((buf.st_mode & S_IFCHR) != 0);
    f43be0
    -}
    f43be0
    -
    f43be0
    -/* get_dev_random_seed */
    f43be0
    -
    f43be0
    -static int get_dev_random_seed(void)
    f43be0
    -{
    f43be0
    -	DEBUG_SEED("get_dev_random_seed");
    f43be0
    +		return -1;
    f43be0
    +	if ((buf.st_mode & S_IFCHR) == 0)
    f43be0
    +		return -1;
    f43be0
     
    f43be0
     	int fd = open(dev_random_file, O_RDONLY);
    f43be0
     	if (fd < 0)
    f43be0
     	{
    f43be0
     		fprintf(stderr, "error opening %s: %s", dev_random_file, strerror(errno));
    f43be0
    -		exit(1);
    f43be0
    +		return -1;
    f43be0
     	}
    f43be0
     
    f43be0
    -	int r;
    f43be0
    -	ssize_t nread = read(fd, &r, sizeof(r));
    f43be0
    -	if (nread != sizeof(r))
    f43be0
    +	ssize_t nread = read(fd, seed, sizeof(*seed));
    f43be0
    +
    f43be0
    +	close(fd);
    f43be0
    +
    f43be0
    +	if (nread != sizeof(*seed))
    f43be0
     	{
    f43be0
     		fprintf(stderr, "error short read %s: %s", dev_random_file, strerror(errno));
    f43be0
    -		exit(1);
    f43be0
    +		return -1;
    f43be0
     	}
    f43be0
     
    f43be0
    -	close(fd);
    f43be0
    -	return r;
    f43be0
    +	return 0;
    f43be0
     }
    f43be0
     
    f43be0
     #endif
    f43be0
     
    f43be0
     /* get_cryptgenrandom_seed */
    f43be0
    @@ -224,55 +267,54 @@ static int get_dev_random_seed(void)
    f43be0
     /* clang-format on */
    f43be0
     #ifndef __GNUC__
    f43be0
     #pragma comment(lib, "advapi32.lib")
    f43be0
     #endif
    f43be0
     
    f43be0
    -static int get_time_seed(void);
    f43be0
    -
    f43be0
    -static int get_cryptgenrandom_seed(void)
    f43be0
    +static int get_cryptgenrandom_seed(int *seed)
    f43be0
     {
    f43be0
     	HCRYPTPROV hProvider = 0;
    f43be0
     	DWORD dwFlags = CRYPT_VERIFYCONTEXT;
    f43be0
    -	int r;
    f43be0
     
    f43be0
     	DEBUG_SEED("get_cryptgenrandom_seed");
    f43be0
     
    f43be0
     	/* WinNT 4 and Win98 do no support CRYPT_SILENT */
    f43be0
     	if (LOBYTE(LOWORD(GetVersion())) > 4)
    f43be0
     		dwFlags |= CRYPT_SILENT;
    f43be0
     
    f43be0
     	if (!CryptAcquireContextA(&hProvider, 0, 0, PROV_RSA_FULL, dwFlags))
    f43be0
     	{
    f43be0
     		fprintf(stderr, "error CryptAcquireContextA 0x%08lx", GetLastError());
    f43be0
    -		r = get_time_seed();
    f43be0
    +		return -1;
    f43be0
     	}
    f43be0
     	else
    f43be0
     	{
    f43be0
    -		BOOL ret = CryptGenRandom(hProvider, sizeof(r), (BYTE*)&r);
    f43be0
    +		BOOL ret = CryptGenRandom(hProvider, sizeof(*seed), (BYTE *)seed);
    f43be0
     		CryptReleaseContext(hProvider, 0);
    f43be0
     		if (!ret)
    f43be0
     		{
    f43be0
     			fprintf(stderr, "error CryptGenRandom 0x%08lx", GetLastError());
    f43be0
    -			r = get_time_seed();
    f43be0
    +			return -1;
    f43be0
     		}
    f43be0
     	}
    f43be0
     
    f43be0
    -	return r;
    f43be0
    +	return 0;
    f43be0
     }
    f43be0
     
    f43be0
     #endif
    f43be0
     
    f43be0
     /* get_time_seed */
    f43be0
     
    f43be0
    +#ifndef HAVE_ARC4RANDOM
    f43be0
     #include <time.h>
    f43be0
     
    f43be0
     static int get_time_seed(void)
    f43be0
     {
    f43be0
     	DEBUG_SEED("get_time_seed");
    f43be0
     
    f43be0
    -	return (int)time(NULL) * 433494437;
    f43be0
    +	return (unsigned)time(NULL) * 433494437;
    f43be0
     }
    f43be0
    +#endif
    f43be0
     
    f43be0
     /* json_c_get_random_seed */
    f43be0
     
    f43be0
     int json_c_get_random_seed(void)
    f43be0
     {
    f43be0
    @@ -281,14 +323,33 @@ int json_c_get_random_seed(void)
    f43be0
     #endif
    f43be0
     #if defined HAVE_RDRAND && HAVE_RDRAND
    f43be0
     	if (has_rdrand())
    f43be0
     		return get_rdrand_seed();
    f43be0
     #endif
    f43be0
    +#ifdef HAVE_ARC4RANDOM
    f43be0
    +	/* arc4random never fails, so use it if it's available */
    f43be0
    +	return arc4random();
    f43be0
    +#else
    f43be0
    +#ifdef HAVE_GETRANDOM
    f43be0
    +	{
    f43be0
    +		int seed = 0;
    f43be0
    +		if (get_getrandom_seed(&seed) == 0)
    f43be0
    +			return seed;
    f43be0
    +	}
    f43be0
    +#endif
    f43be0
     #if defined HAVE_DEV_RANDOM && HAVE_DEV_RANDOM
    f43be0
    -	if (has_dev_urandom())
    f43be0
    -		return get_dev_random_seed();
    f43be0
    +	{
    f43be0
    +		int seed = 0;
    f43be0
    +		if (get_dev_random_seed(&seed) == 0)
    f43be0
    +			return seed;
    f43be0
    +	}
    f43be0
     #endif
    f43be0
     #if defined HAVE_CRYPTGENRANDOM && HAVE_CRYPTGENRANDOM
    f43be0
    -	return get_cryptgenrandom_seed();
    f43be0
    +	{
    f43be0
    +		int seed = 0;
    f43be0
    +		if (get_cryptgenrandom_seed(&seed) == 0)
    f43be0
    +			return seed;
    f43be0
    +	}
    f43be0
     #endif
    f43be0
     	return get_time_seed();
    f43be0
    +#endif /* !HAVE_ARC4RANDOM */
    f43be0
     }
    f43be0
    diff --git a/comm/third_party/json-c/strerror_override.c b/comm/third_party/json-c/strerror_override.c
    f43be0
    --- a/comm/third_party/json-c/strerror_override.c
    f43be0
    +++ b/comm/third_party/json-c/strerror_override.c
    f43be0
    @@ -92,18 +92,19 @@ char *_json_c_strerror(int errno_in)
    f43be0
     		errno_buf[start_idx] = '\0';
    f43be0
     		return errno_buf;
    f43be0
     	}
    f43be0
     
    f43be0
     	// It's not one of the known errno values, return the numeric value.
    f43be0
    -	for (ii = 0; errno_in > 10; errno_in /= 10, ii++)
    f43be0
    +	for (ii = 0; errno_in >= 10; errno_in /= 10, ii++)
    f43be0
     	{
    f43be0
     		digbuf[ii] = "0123456789"[(errno_in % 10)];
    f43be0
     	}
    f43be0
     	digbuf[ii] = "0123456789"[(errno_in % 10)];
    f43be0
     
    f43be0
     	// Reverse the digits
    f43be0
     	for (start_idx = sizeof(PREFIX) - 1; ii >= 0; ii--, start_idx++)
    f43be0
     	{
    f43be0
     		errno_buf[start_idx] = digbuf[ii];
    f43be0
     	}
    f43be0
    +	errno_buf[start_idx] = '\0';
    f43be0
     	return errno_buf;
    f43be0
     }
    f43be0
    diff --git a/comm/third_party/json-c/vasprintf_compat.h b/comm/third_party/json-c/vasprintf_compat.h
    f43be0
    --- a/comm/third_party/json-c/vasprintf_compat.h
    f43be0
    +++ b/comm/third_party/json-c/vasprintf_compat.h
    f43be0
    @@ -6,41 +6,48 @@
    f43be0
      * @brief Do not use, json-c internal, may be changed or removed at any time.
    f43be0
      */
    f43be0
     
    f43be0
     #include "snprintf_compat.h"
    f43be0
     
    f43be0
    +#ifndef WIN32
    f43be0
    +#include <stdarg.h>
    f43be0
    +#endif /* !defined(WIN32) */
    f43be0
    +#include <stdint.h>
    f43be0
     #include <stdlib.h>
    f43be0
     
    f43be0
     #if !defined(HAVE_VASPRINTF)
    f43be0
     /* CAW: compliant version of vasprintf */
    f43be0
     static int vasprintf(char **buf, const char *fmt, va_list ap)
    f43be0
     {
    f43be0
     #ifndef WIN32
    f43be0
     	static char _T_emptybuffer = '\0';
    f43be0
    +	va_list ap2;
    f43be0
     #endif /* !defined(WIN32) */
    f43be0
     	int chars;
    f43be0
     	char *b;
    f43be0
     
    f43be0
     	if (!buf)
    f43be0
     	{
    f43be0
     		return -1;
    f43be0
     	}
    f43be0
     
    f43be0
     #ifdef WIN32
    f43be0
    -	chars = _vscprintf(fmt, ap) + 1;
    f43be0
    +	chars = _vscprintf(fmt, ap);
    f43be0
     #else  /* !defined(WIN32) */
    f43be0
     	/* CAW: RAWR! We have to hope to god here that vsnprintf doesn't overwrite
    f43be0
    -	 * our buffer like on some 64bit sun systems.... but hey, its time to move on
    f43be0
    +	 * our buffer like on some 64bit sun systems... but hey, it's time to move on
    f43be0
     	 */
    f43be0
    -	chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap) + 1;
    f43be0
    -	if (chars < 0)
    f43be0
    +	va_copy(ap2, ap);
    f43be0
    +	chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap2);
    f43be0
    +	va_end(ap2);
    f43be0
    +#endif /* defined(WIN32) */
    f43be0
    +	if (chars < 0 || (size_t)chars + 1 > SIZE_MAX / sizeof(char))
    f43be0
     	{
    f43be0
    -		chars *= -1;
    f43be0
    -	} /* CAW: old glibc versions have this problem */
    f43be0
    -#endif /* defined(WIN32) */
    f43be0
    +		return -1;
    f43be0
    +	}
    f43be0
     
    f43be0
    -	b = (char *)malloc(sizeof(char) * chars);
    f43be0
    +	b = (char *)malloc(sizeof(char) * ((size_t)chars + 1));
    f43be0
     	if (!b)
    f43be0
     	{
    f43be0
     		return -1;
    f43be0
     	}
    f43be0