summaryrefslogtreecommitdiff
path: root/devel/jq/patches
diff options
context:
space:
mode:
Diffstat (limited to 'devel/jq/patches')
-rw-r--r--devel/jq/patches/patch-Makefile.am15
-rw-r--r--devel/jq/patches/patch-Makefile.in15
-rw-r--r--devel/jq/patches/patch-builtin.c16
-rw-r--r--devel/jq/patches/patch-compile.c6
-rw-r--r--devel/jq/patches/patch-configure.ac6
-rw-r--r--devel/jq/patches/patch-inject__errors.c6
-rw-r--r--devel/jq/patches/patch-src_jv__parse.c38
-rw-r--r--devel/jq/patches/patch-src_jv__print.c41
-rw-r--r--devel/jq/patches/patch-util.c6
9 files changed, 38 insertions, 111 deletions
diff --git a/devel/jq/patches/patch-Makefile.am b/devel/jq/patches/patch-Makefile.am
new file mode 100644
index 00000000000..fb81b2140ba
--- /dev/null
+++ b/devel/jq/patches/patch-Makefile.am
@@ -0,0 +1,15 @@
+$NetBSD: patch-Makefile.am,v 1.1 2018/11/03 12:47:16 leot Exp $
+
+Fix dynamic linking.
+
+--- Makefile.am.orig 2018-11-02 01:49:29.000000000 +0000
++++ Makefile.am
+@@ -106,7 +106,7 @@ src/builtin.o: src/builtin.inc
+
+ bin_PROGRAMS = jq
+ jq_SOURCES = src/main.c src/version.h
+-jq_LDFLAGS = -static-libtool-libs
++jq_LDFLAGS =
+ jq_LDADD = libjq.la -lm
+
+ if WIN32
diff --git a/devel/jq/patches/patch-Makefile.in b/devel/jq/patches/patch-Makefile.in
deleted file mode 100644
index 20fcd321f8d..00000000000
--- a/devel/jq/patches/patch-Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-Makefile.in,v 1.1 2018/01/15 08:51:55 adam Exp $
-
-Fix dynamic linking.
-
---- Makefile.in.orig 2018-01-15 08:41:01.000000000 +0000
-+++ Makefile.in
-@@ -681,7 +681,7 @@ include_HEADERS = jv.h jq.h
- @ENABLE_ERROR_INJECTION_TRUE@libinject_errors_la_LDFLAGS = -module
- generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | sed 's/.*/\#define JQ_VERSION \"&\"/'`"
- jq_SOURCES = main.c version.h
--jq_LDFLAGS = -static-libtool-libs $(am__append_3)
-+jq_LDFLAGS = @ENABLE_ALL_STATIC_TRUE@-static-libtool-libs $(am__append_3)
- jq_LDADD = libjq.la -lm
-
- ### Tests (make check)
diff --git a/devel/jq/patches/patch-builtin.c b/devel/jq/patches/patch-builtin.c
index a989884a04f..fa0a079554c 100644
--- a/devel/jq/patches/patch-builtin.c
+++ b/devel/jq/patches/patch-builtin.c
@@ -1,4 +1,4 @@
-$NetBSD: patch-builtin.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+$NetBSD: patch-builtin.c,v 1.2 2018/11/03 12:47:16 leot Exp $
Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
because the result of the configure command may be inconsistent with it.
@@ -11,12 +11,18 @@ Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
Also shared via PR pkg/52460.
---- builtin.c.orig 2015-08-18 04:25:04.000000000 +0000
-+++ builtin.c
-@@ -1,6 +1,3 @@
+--- src/builtin.c.orig 2018-11-02 01:49:29.000000000 +0000
++++ src/builtin.c
+@@ -1,12 +1,3 @@
-#define _BSD_SOURCE
-#define _GNU_SOURCE
--#define _XOPEN_SOURCE
+-#ifndef __sun__
+-# define _XOPEN_SOURCE
+-# define _XOPEN_SOURCE_EXTENDED 1
+-#else
+-# define _XPG6
+-# define __EXTENSIONS__
+-#endif
#include <sys/time.h>
#include <stdlib.h>
#include <stddef.h>
diff --git a/devel/jq/patches/patch-compile.c b/devel/jq/patches/patch-compile.c
index fdb975f54d1..d4383cbb626 100644
--- a/devel/jq/patches/patch-compile.c
+++ b/devel/jq/patches/patch-compile.c
@@ -1,4 +1,4 @@
-$NetBSD: patch-compile.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+$NetBSD: patch-compile.c,v 1.2 2018/11/03 12:47:16 leot Exp $
Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
because the result of the configure command may be inconsistent with it.
@@ -11,8 +11,8 @@ Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
Also shared via PR pkg/52460.
---- compile.c.orig 2015-08-18 04:25:04.000000000 +0000
-+++ compile.c
+--- src/compile.c.orig 2015-08-18 04:25:04.000000000 +0000
++++ src/compile.c
@@ -1,6 +1,3 @@
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE // for strdup
diff --git a/devel/jq/patches/patch-configure.ac b/devel/jq/patches/patch-configure.ac
index 59e93b940d9..93d3a4537a5 100644
--- a/devel/jq/patches/patch-configure.ac
+++ b/devel/jq/patches/patch-configure.ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure.ac,v 1.3 2018/08/19 18:08:05 leot Exp $
+$NetBSD: patch-configure.ac,v 1.4 2018/11/03 12:47:16 leot Exp $
Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
because the result of the configure command may be inconsistent with it.
@@ -11,11 +11,11 @@ Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
Also shared via PR pkg/52460.
---- configure.ac.orig 2015-08-18 04:25:04.000000000 +0000
+--- configure.ac.orig 2018-11-02 14:52:43.000000000 +0000
+++ configure.ac
@@ -11,6 +11,7 @@ AC_PREREQ([2.64])
AC_CONFIG_AUX_DIR([config])
- AM_INIT_AUTOMAKE([1.11.2 parallel-tests foreign -Wall])
+ AM_INIT_AUTOMAKE([1.11.2 subdir-objects parallel-tests foreign -Wall])
AM_SILENT_RULES([yes])
+AC_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
diff --git a/devel/jq/patches/patch-inject__errors.c b/devel/jq/patches/patch-inject__errors.c
index 8dd3ce33bd0..18bf189d5cc 100644
--- a/devel/jq/patches/patch-inject__errors.c
+++ b/devel/jq/patches/patch-inject__errors.c
@@ -1,4 +1,4 @@
-$NetBSD: patch-inject__errors.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+$NetBSD: patch-inject__errors.c,v 1.2 2018/11/03 12:47:16 leot Exp $
Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
because the result of the configure command may be inconsistent with it.
@@ -11,8 +11,8 @@ Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
Also shared via PR pkg/52460.
---- inject_errors.c.orig 2015-08-18 04:25:04.000000000 +0000
-+++ inject_errors.c
+--- src/inject_errors.c.orig 2015-08-18 04:25:04.000000000 +0000
++++ src/inject_errors.c
@@ -1,5 +1,3 @@
-
-#define _GNU_SOURCE /* for RTLD_NEXT */
diff --git a/devel/jq/patches/patch-src_jv__parse.c b/devel/jq/patches/patch-src_jv__parse.c
deleted file mode 100644
index 70a540e25b7..00000000000
--- a/devel/jq/patches/patch-src_jv__parse.c
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD: patch-src_jv__parse.c,v 1.1 2016/05/10 09:20:52 tnn Exp $
-
-CVE-2015-8863
-
-From 8eb1367ca44e772963e704a700ef72ae2e12babd Mon Sep 17 00:00:00 2001
-From: Nicolas Williams <nico@cryptonector.com>
-Date: Sat, 24 Oct 2015 17:24:57 -0500
-Subject: [PATCH] Heap buffer overflow in tokenadd() (fix #105)
-
-This was an off-by one: the NUL terminator byte was not allocated on
-resize. This was triggered by JSON-encoded numbers longer than 256
-bytes.
----
- src/jv_parse.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/jv_parse.c b/src/jv_parse.c
-index 3102ed4..84245b8 100644
---- jv_parse.c
-+++ jv_parse.c
-@@ -383,7 +383,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
-
- static void tokenadd(struct jv_parser* p, char c) {
- assert(p->tokenpos <= p->tokenlen);
-- if (p->tokenpos == p->tokenlen) {
-+ if (p->tokenpos >= (p->tokenlen - 1)) {
- p->tokenlen = p->tokenlen*2 + 256;
- p->tokenbuf = jv_mem_realloc(p->tokenbuf, p->tokenlen);
- }
-@@ -485,7 +485,7 @@ static pfunc check_literal(struct jv_parser* p) {
- TRY(value(p, v));
- } else {
- // FIXME: better parser
-- p->tokenbuf[p->tokenpos] = 0; // FIXME: invalid
-+ p->tokenbuf[p->tokenpos] = 0;
- char* end = 0;
- double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end);
- if (end == 0 || *end != 0)
diff --git a/devel/jq/patches/patch-src_jv__print.c b/devel/jq/patches/patch-src_jv__print.c
deleted file mode 100644
index 3dfd543f8ae..00000000000
--- a/devel/jq/patches/patch-src_jv__print.c
+++ /dev/null
@@ -1,41 +0,0 @@
-$NetBSD: patch-src_jv__print.c,v 1.1 2018/05/30 16:03:48 ginsbach Exp $
-
-CVE-2016-4074
-
-From 83e2cf607f3599d208b6b3129092fa7deb2e5292 Mon Sep 17 00:00:00 2001
-From: W-Mark Kubacki <wmark@hurrikane.de>
-Date: Fri, 19 Aug 2016 19:50:39 +0200
-Subject: [PATCH] Skip printing what's below a MAX_PRINT_DEPTH
-
-This addresses #1136, and mitigates a stack exhaustion when printing
-a very deeply nested term.
----
- src/jv_print.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/src/jv_print.c b/src/jv_print.c
-index 5f4f234b..ce4a59af 100644
---- jv_print.c
-+++ jv_print.c
-@@ -13,6 +13,10 @@
- #include "jv_dtoa.h"
- #include "jv_unicode.h"
-
-+#ifndef MAX_PRINT_DEPTH
-+#define MAX_PRINT_DEPTH (256)
-+#endif
-+
- #define ESC "\033"
- #define COL(c) (ESC "[" c "m")
- #define COLRESET (ESC "[0m")
-@@ -150,7 +154,9 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
- }
- }
- }
-- switch (jv_get_kind(x)) {
-+ if (indent > MAX_PRINT_DEPTH) {
-+ put_str("<skipped: too deep>", F, S, flags & JV_PRINT_ISATTY);
-+ } else switch (jv_get_kind(x)) {
- default:
- case JV_KIND_INVALID:
- if (flags & JV_PRINT_INVALID) {
diff --git a/devel/jq/patches/patch-util.c b/devel/jq/patches/patch-util.c
index 275f1d2ba04..720a522f44e 100644
--- a/devel/jq/patches/patch-util.c
+++ b/devel/jq/patches/patch-util.c
@@ -1,4 +1,4 @@
-$NetBSD: patch-util.c,v 1.1 2018/08/19 18:08:05 leot Exp $
+$NetBSD: patch-util.c,v 1.2 2018/11/03 12:47:16 leot Exp $
Defining _GNU_SOURCE, _BSD_SOURCE etc. in C sources is problematic,
because the result of the configure command may be inconsistent with it.
@@ -11,8 +11,8 @@ Part of pull request 1458, commit id `df9a0963f8fa6fca773b059dce22c598152f3edb':
Also shared via PR pkg/52460.
---- util.c.orig 2015-08-18 04:25:04.000000000 +0000
-+++ util.c
+--- src/util.c.orig 2015-08-18 04:25:04.000000000 +0000
++++ src/util.c
@@ -1,8 +1,3 @@
-
-#ifdef HAVE_MEMMEM