]> granicus.if.org Git - json-c/commit
Fix integer overflows.
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 4 May 2020 17:47:25 +0000 (19:47 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 6 May 2020 18:46:12 +0000 (20:46 +0200)
commitd07b91014986900a3a75f306d302e13e005e9d67
tree203bd92786e92b5c6d2f5a0bc6e09624f16343fd
parent77d935b7ae7871a1940cd827e850e6063044ec45
Fix integer overflows.

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

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

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