<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gpgme/src/cJSON.c, branch gpgme-1.14-base</title>
<subtitle>GnuPG Made Easy.</subtitle>
<id>http://git.bktus.com/gpgfrontend/gpgme/atom?h=gpgme-1.14-base</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/gpgme/atom?h=gpgme-1.14-base'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/'/>
<updated>2019-06-04T08:56:48Z</updated>
<entry>
<title>json: Print "nan", "-inf", "inf" if needed.</title>
<updated>2019-06-04T08:56:48Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2019-06-04T08:56:48Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=f56c996318dfa1c9f0d10582b18c2fce10d24668'/>
<id>urn:sha1:f56c996318dfa1c9f0d10582b18c2fce10d24668</id>
<content type='text'>
* src/cJSON.c (print_number): Print NaN and INF.
--

GnuPG-bug-id: 4328
Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>json: Improve handling of large exponents in the JSON parsor.</title>
<updated>2019-06-04T08:42:40Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2019-06-04T08:42:40Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=fabe96126b4ed9c5e07b713813d7db26a02e5e5f'/>
<id>urn:sha1:fabe96126b4ed9c5e07b713813d7db26a02e5e5f</id>
<content type='text'>
* src/cJSON.c: Include stdint.h.
(parse_number): Avoid overflob in SUBSCALE and cap integer values.
--

GnuPG-bug-id: 4330
Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>json: Limit recursion depth</title>
<updated>2019-02-27T13:27:47Z</updated>
<author>
<name>Andre Heinecke</name>
<email>aheinecke@gnupg.org</email>
</author>
<published>2019-02-27T13:27:47Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=4a117859e7a512458ab78cfedfae0372805196b1'/>
<id>urn:sha1:4a117859e7a512458ab78cfedfae0372805196b1</id>
<content type='text'>
* src/cJSON.c (MAX_DEPTH): New. Maximum recursion depth.
(parse_value, parse_array, parse_object): Carry and check
depth argument.
(cJSON_ParseWithOpts): Initialize depth.

--
This fixes a stack overflow if we get weird recursive
json data.

GnuPG-Bug-Id: T4331
</content>
</entry>
<entry>
<title>core: Silence newer compiler warnings.</title>
<updated>2018-12-17T15:47:27Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-12-17T15:47:06Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=8b41fb08f00f01fe0dd8b2b5455d3422d97ddc60'/>
<id>urn:sha1:8b41fb08f00f01fe0dd8b2b5455d3422d97ddc60</id>
<content type='text'>
* configure.ac: Add -Wno-format-truncation and
  -Wno-sizeof-pointer-div.
* src/b64dec.c (_gpgme_b64dec_proc): Add fallthrough annotation.
* src/cJSON.c (parse_string): Ditto.
* src/gpgme-json.c (main): Ditto.
--

gcc 8 enables a couple of new warnings.  Some of them are useless for
us.  In particular:

  util.h:42:26: warning: division 'sizeof (char *) / sizeof (char)'
  does not compute the number of array elements [-Wsizeof-pointer-div]
  #define DIM(v) (sizeof(v)/sizeof((v)[0])) ^

  trustlist.c:101:22: note:
  in expansion of macro 'DIM' if (strlen (p) == DIM(item-&gt;keyid) - 1)

Which is a real standard way to use DIM, here the right hand side is
equivalent to sizeof but nevertheless it is correct.  Yes sir, we know
C.

The format string warnings I have seen were assuming that the time
structure returns valued out of scope - but if the system is that
broken, the s_n_printf catches this.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>json: Wipe memory in cJSON_Delete</title>
<updated>2018-08-08T12:27:24Z</updated>
<author>
<name>Andre Heinecke</name>
<email>aheinecke@intevation.de</email>
</author>
<published>2018-08-08T12:27:24Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=4dd1d0abd34a382d1cd67cabb737950a39cb3fdc'/>
<id>urn:sha1:4dd1d0abd34a382d1cd67cabb737950a39cb3fdc</id>
<content type='text'>
* src/cJSON.c (cJSON_Delete): Wipe memory on deletion.
</content>
</entry>
<entry>
<title>json: Only use calloc instead of malloc</title>
<updated>2018-08-08T12:25:28Z</updated>
<author>
<name>Andre Heinecke</name>
<email>aheinecke@intevation.de</email>
</author>
<published>2018-08-08T12:25:28Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=fdc07b3ddc2f68e6fcb33703ea41126d0a841290'/>
<id>urn:sha1:fdc07b3ddc2f68e6fcb33703ea41126d0a841290</id>
<content type='text'>
* src/cJSON.c, src/gpgme-json.c (CALLOC_ONLY): New define
to change xmalloc / xtrymalloc to use calloc.

--
Some people consider malloc dangerous as it might allow an
information leak.
</content>
</entry>
<entry>
<title>json: Add checks when skipping byte</title>
<updated>2018-08-08T11:30:01Z</updated>
<author>
<name>Andre Heinecke</name>
<email>aheinecke@intevation.de</email>
</author>
<published>2018-08-08T11:30:01Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=974a95db04f9cdea02867f0246445b4679517ba0'/>
<id>urn:sha1:974a95db04f9cdea02867f0246445b4679517ba0</id>
<content type='text'>
* src/cJSON.c (parse_string, cJSON_Minify): Check for
terminating NULL byte when skipping the byte after a an escaped
quote.
</content>
</entry>
<entry>
<title>json: Minor cleanups in cJSON.c</title>
<updated>2018-07-16T12:42:30Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-07-16T12:42:30Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=1933f5b8056b2671301379106cca4504c4187795'/>
<id>urn:sha1:1933f5b8056b2671301379106cca4504c4187795</id>
<content type='text'>
* src/cJSON.c: Add comments on the origin of the code.
(parse_string): Allocate an extra byte for safeness.
(cJSON_AddItemToArray): Allo ARRAY to be NULL.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>json: Fix buffer overflow in cJSON.c</title>
<updated>2018-07-16T10:37:06Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-07-16T10:34:52Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=013a7f47ab486c380b3c97637d3b15f11de74fe8'/>
<id>urn:sha1:013a7f47ab486c380b3c97637d3b15f11de74fe8</id>
<content type='text'>
* src/cJSON.c (parse_string): Correctly detect bad hex.
--

The call to parse_hex4 checks that only hex digits follow and in the
error case returns 0.  However, by the time of the combined check for
an invalid value and the error PTR has already been set to the last
hex character and thus if the end-of-string or a quote character was
one of the bad hex digits the loop will miss the end of the string
which does not match with the simple buffer length allocation test at
the begin of the function.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>json: Allow to compile with libgpg-error &lt; 1.28</title>
<updated>2018-06-05T07:40:17Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-06-05T07:40:17Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=998fec8a4fbc46315fe6836980954eed402b38c5'/>
<id>urn:sha1:998fec8a4fbc46315fe6836980954eed402b38c5</id>
<content type='text'>
* src/cJSON.c: Use gpgrt fucntion only if available.
--

We have a hack in gpgme-json to allow building with older libgpg-error
versions.  That whole thing will not work but the instead the binary
will print an error at runtime that it needs to be build with a newer
libgcrypt.  There was a little bug here for the Debian packages
libgpg-error versions which failed to build cJSON.  cJSON is only
needed be the full gpgme-json but nevertheless the Makefile wants to
build it.  The fix is straightforward.

GnuPG-bug-id: 3971
Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
</feed>
