this resulted in behaviour of LOGIN vs. PLAIN being inconsistent under
bad coding of authenticators.
+JH/39 Bug 3023: Fix crash induced by some combinations of zero-length strings
+ and ${tr...}. Found and diagnosed by Heiko Schlichting.
+
Exim version 4.96
-----------------
case 3: goto EXPAND_FAILED;
}
- yield = string_cat(yield, sub[0]);
- o2m = Ustrlen(sub[2]) - 1;
-
- if (o2m >= 0) for (; oldptr < yield->ptr; oldptr++)
+ if ( (yield = string_cat(yield, sub[0]))
+ && (o2m = Ustrlen(sub[2]) - 1) >= 0)
+ for (; oldptr < yield->ptr; oldptr++)
{
uschar * m = Ustrrchr(sub[1], yield->s[oldptr]);
if (m)
{
int o = m - sub[1];
- yield->s[oldptr] = sub[2][(o < o2m)? o : o2m];
+ yield->s[oldptr] = sub[2][o < o2m ? o : o2m];
}
}
abcdea a z ${tr{abcdea}{a}{z}}
abcdea a ${tr{abcdea}{a}{}}
abcdea abc z ${tr{abcdea}{abc}{z}}
+(null) '${sg{$header_foobar:${tr{}{}{foobar}}}{}{}}'
# Boolean
"TrUe" ${if bool{TrUe}{true}{false}} EXPECT: true