diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2023-02-02 20:00:35 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2023-02-02 20:00:35 +0000 |
commit | 70069b65a39a7ba73a36fbd95371ff03cde1eb23 (patch) | |
tree | 73e8353999ed7751a88586f2b57c8b1914bfc232 /src | |
parent | 04e5caa9a7e84b2afca642d28096d988cb6802e7 (diff) | |
download | exim4-70069b65a39a7ba73a36fbd95371ff03cde1eb23.tar.gz |
Fix crash in expansions
Broken-by: 1058096b8c53
Diffstat (limited to 'src')
-rw-r--r-- | src/src/expand.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/src/expand.c b/src/src/expand.c index 10f009ce2..a7e6e4fb3 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -4747,7 +4747,7 @@ while (*s) continue; } - if (isdigit(*s)) + if (isdigit(*s)) /* A $<n> variable */ { int n; s = read_cnumber(&n, s); @@ -7165,6 +7165,7 @@ NOT_ITEM: ; /* Deal specially with operators that might take a certificate variable as we do not want to do the usual expansion. For most, expand the string.*/ + switch(c) { #ifndef DISABLE_TLS @@ -7213,7 +7214,7 @@ NOT_ITEM: ; to the main loop top. */ { - int start = yield->ptr; + unsigned expansion_start = gstring_length(yield); switch(c) { case EOP_BASE32: @@ -8275,8 +8276,8 @@ NOT_ITEM: ; DEBUG(D_expand) { - const uschar * s = yield->s + start; - int i = yield->ptr - start; + const uschar * s = yield->s + expansion_start; + int i = gstring_length(yield) - expansion_start; BOOL tainted = is_tainted(s); DEBUG(D_noutf8) |