mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
Fixes the following vulnerabilities by importing upstream patches: - CVE-2026-39979:2f09060afa- CVE-2026-33948:6374ae0bcd- CVE-2026-33947:fb59f14910- CVE-2026-32316:e47e56d226- CVE-2026-40164:0c7d133c3c- CVE-2026-40612:d1a12569d9- CVE-2026-41256:5a015deae3- CVE-2026-41257:01b3cded76- CVE-2026-43894:9761ceb7d6- CVE-2026-43895:9d223f153c- CVE-2026-43896:532ccea608- CVE-2026-44777:f58787c418- CVE-2026-47770:7122866869- CVE-2026-49839:e987df0d46- CVE-2026-54679:46d1da3094Tests were stripped out of the patches. Signed-off-by: Thomas Perale <thomas.perale@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
From 5a015deae35d19e3ebbc65db6c157a80e76df738 Mon Sep 17 00:00:00 2001
|
|
From: itchyny <itchyny@cybozu.co.jp>
|
|
Date: Fri, 24 Apr 2026 22:15:08 +0900
|
|
Subject: [PATCH] Fix NUL truncation in program files loaded with -f
|
|
|
|
This fixes CVE-2026-41256.
|
|
|
|
CVE: CVE-2026-41256
|
|
Upstream: https://github.com/jqlang/jq/commit/5a015deae35d19e3ebbc65db6c157a80e76df738
|
|
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
|
---
|
|
src/main.c | 8 ++++++++
|
|
tests/shtest | 7 +++++++
|
|
2 files changed, 15 insertions(+)
|
|
|
|
diff --git a/src/main.c b/src/main.c
|
|
index ce362607e2..fb5c7ab8e3 100644
|
|
--- a/src/main.c
|
|
+++ b/src/main.c
|
|
@@ -611,6 +611,14 @@ int main(int argc, char* argv[]) {
|
|
ret = JQ_ERROR_SYSTEM;
|
|
goto out;
|
|
}
|
|
+ int len = jv_string_length_bytes(jv_copy(data));
|
|
+ if ((size_t)len != strlen(jv_string_value(data))) {
|
|
+ fprintf(stderr, "jq: program file contains NUL bytes\n");
|
|
+ free(program_origin);
|
|
+ jv_free(data);
|
|
+ ret = JQ_ERROR_SYSTEM;
|
|
+ goto out;
|
|
+ }
|
|
jq_set_attr(jq, jv_string("PROGRAM_ORIGIN"), jq_realpath(jv_string(dirname(program_origin))));
|
|
ARGS = JV_OBJECT(jv_string("positional"), ARGS,
|
|
jv_string("named"), jv_copy(program_arguments));
|