aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorvanilla <vanilla@FreeBSD.org>2016-05-04 14:25:13 +0800
committervanilla <vanilla@FreeBSD.org>2016-05-04 14:25:13 +0800
commit69305ff863696711d476d82c11a2605b57311d27 (patch)
tree8137fd862c14c8d57f4c40eb640f99c36416751d /devel
parent433816d8524a6826fa27376d89afbad4dfbcc1e7 (diff)
downloadfreebsd-ports-gnome-69305ff863696711d476d82c11a2605b57311d27.tar.gz
freebsd-ports-gnome-69305ff863696711d476d82c11a2605b57311d27.tar.zst
freebsd-ports-gnome-69305ff863696711d476d82c11a2605b57311d27.zip
Fix CVE-2016-4425.
PR: 209219 Submitted by: junovitch@
Diffstat (limited to 'devel')
-rw-r--r--devel/jansson/Makefile4
-rw-r--r--devel/jansson/files/patch-CVE-2016-442543
2 files changed, 46 insertions, 1 deletions
diff --git a/devel/jansson/Makefile b/devel/jansson/Makefile
index c07cb5dbb7e4..246e83c0c3c9 100644
--- a/devel/jansson/Makefile
+++ b/devel/jansson/Makefile
@@ -3,7 +3,7 @@
PORTNAME= jansson
PORTVERSION= 2.7
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= http://www.digip.org/jansson/releases/
@@ -17,5 +17,7 @@ USES= cpe pathfix pkgconfig gmake tar:bzip2 libtool
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CPE_VENDOR= jansson_project
+INSTALL_TARGET= install-strip
+TEST_TARGET= check
.include <bsd.port.mk>
diff --git a/devel/jansson/files/patch-CVE-2016-4425 b/devel/jansson/files/patch-CVE-2016-4425
new file mode 100644
index 000000000000..e28d163fd88d
--- /dev/null
+++ b/devel/jansson/files/patch-CVE-2016-4425
@@ -0,0 +1,43 @@
+--- src/jansson_config.h.in.orig 2016-05-04 11:43:48.386196000 +0800
++++ src/jansson_config.h.in 2016-05-04 11:44:21.204996000 +0800
+@@ -36,4 +36,8 @@
+ otherwise to 0. */
+ #define JSON_HAVE_LOCALECONV @json_have_localeconv@
+
++/* Maximum recursion depth for parsing JSON input.
++ * This limits the depth of e.g. array-within-array constructions. */
++#define JSON_PARSER_MAX_DEPTH 2048
++
+ #endif
+--- src/load.c.orig 2016-05-04 11:44:34.356957000 +0800
++++ src/load.c 2016-05-04 11:46:44.547307000 +0800
+@@ -61,6 +61,7 @@ typedef struct {
+ typedef struct {
+ stream_t stream;
+ strbuffer_t saved_text;
++ size_t depth;
+ int token;
+ union {
+ struct {
+@@ -800,6 +801,12 @@ static json_t *parse_value(lex_t *lex, s
+ json_t *json;
+ double value;
+
++ lex->depth++;
++ if(lex->depth > JSON_PARSER_MAX_DEPTH) {
++ error_set(error, lex, "maximum parsing depth reached");
++ return NULL;
++ }
++
+ switch(lex->token) {
+ case TOKEN_STRING: {
+ const char *value = lex->value.string.val;
+@@ -877,6 +884,8 @@ static json_t *parse_json(lex_t *lex, si
+ {
+ json_t *result;
+
++ lex->depth = 0;
++
+ lex_scan(lex, error);
+ if(!(flags & JSON_DECODE_ANY)) {
+ if(lex->token != '[' && lex->token != '{') {