[packages/exim] Rel 2; for*_json treat an empty list as having no items
arekm
arekm at pld-linux.org
Wed Nov 25 15:55:06 CET 2026
commit 5152f7c70e53b47e67ed9bab2c2d8d3a0eac13fb
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Nov 25 15:53:04 2026 +0100
Rel 2; for*_json treat an empty list as having no items
A missing header made forany_json/forall_json defer every message.
exim-forall-json-unwrap.patch | 12 +++++++-----
exim.spec | 2 +-
2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/exim.spec b/exim.spec
index 1e7dd76..410367a 100644
--- a/exim.spec
+++ b/exim.spec
@@ -23,7 +23,7 @@ Summary(pl.UTF-8): Agent Transferu Poczty Uniwersytetu w Cambridge
Summary(pt_BR.UTF-8): Servidor de correio eletrônico exim
Name: exim
Version: 4.100.2
-Release: 1
+Release: 2
Epoch: 2
License: GPL v2+
Group: Networking/Daemons/SMTP
diff --git a/exim-forall-json-unwrap.patch b/exim-forall-json-unwrap.patch
index 1385511..baf6e04 100644
--- a/exim-forall-json-unwrap.patch
+++ b/exim-forall-json-unwrap.patch
@@ -1,11 +1,13 @@
Expansions: fix crash in forall_json/forany_json on an unwrappable list
dewrap() returns NULL for a list without its [ ], and json_nextinlist()
-then dereferences it. A skipped condition always hits this, as its list
-expands to an empty string, e.g. ${if or{{true}{forany_json{[1]}{...}}}}.
+then dereferences it. An empty list, e.g. $h_ of a missing header, or
+any skipped condition, ${if or{{true}{forany_json{[1]}{...}}}}, hit this.
+Treat an empty list as having no items, like the non-json forms, and
+fail the expansion for a malformed one.
---
diff --git a/src/expand.c b/src/expand.c
-index 266b664..69cab30 100644
+index 266b664..8b8d2e8 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -3549,7 +3549,13 @@ switch(cond_type = identify_operator(&s, &opname))
@@ -13,8 +15,8 @@ index 266b664..69cab30 100644
if (yield) *yield = !testfor;
list = sub[0];
- if (is_json) list = dewrap(string_copy(list), US"[]");
-+ /* When skipping, sub[0] is empty and must not be unwrapped */
-+ if (is_json && yield && !(list = dewrap(string_copy(list), US"[]")))
++ /* An empty list (also what a skipped condition expands to) has no items */
++ if (is_json && yield && *list && !(list = dewrap(string_copy(list), US"[]")))
+ {
+ expand_string_message = string_sprintf("%s wrapping list for %s",
+ expand_string_message, opname);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/exim.git/commitdiff/5152f7c70e53b47e67ed9bab2c2d8d3a0eac13fb
More information about the pld-cvs-commit
mailing list