Jeremie Courreges-Anglas <[email protected]> wrote:

> 
> 
> exim apparently uses printf("%n"), which is currently forbidden (libc
> calls abort(3)).
> 
> I don't want us to fix all the %n uses in the ports tree, but instead
> wait for user reports.  Though for some software like exim it makes
> sense to help users avoid such a hard crash.
> 
> The diff below doesn't pretend to fix all uses of %n in the exim source.
> There may be others that can't be flagged by the compiler (support for
> that hesn't been committed yet) because of indirections through wrapper
> functions.
> +--- src/acl.c.orig
> ++++ src/acl.c
> +@@ -2906,10 +2906,12 @@ for (; cb; cb = cb->next)
> + 
> +   HDEBUG(D_acl)
> +     {
> +-    int lhswidth = 0;
> +-    debug_printf_indent("check %s%s %n",
> ++    uschar buf[256];
> ++    int lhswidth = snprintf(CS buf, sizeof buf, "check %s%s ",
> +       (!conditions[cb->type].is_modifier && cb->u.negated)? "!":"",
> +-      conditions[cb->type].name, &lhswidth);
> ++      conditions[cb->type].name);
> ++    if (lhswidth == -1) lhswidth = 0;
> ++    debug_printf_indent("%s");

Doesn't this %s need an argument buf?

Reply via email to