Wietse Venema:
> Wietse Venema:
> > > The panic message says "%s" therefore this VBUF_SNPRINTF() call is
> > > made while formatting a string with an fmt value of "%s".
> > 
> > Unfortunately, the panic call overwrites the format string that was
> > involved with the error, so the analysis for width and precision
> > is wrong.
> 
> If you built Postfix from source, applying this will save the
> format string during panic, and may make problem diagnosis
> possible.

Sorry, you also have to add a ``#include "mymalloc.h"'' line.

        Wietse

--- /var/tmp/postfix-3.3-20170730/src/util/vbuf_print.c 2017-01-01 
10:58:50.000000000 -0500
+++ src/util/vbuf_print.c       2017-08-30 19:47:51.000000000 -0400
@@ -64,6 +64,7 @@
 /* Application-specific. */
 
 #include "msg.h"
+#include "mymalloc.h"
 #include "vbuf.h"
 #include "vstring.h"
 #include "vbuf_print.h"
@@ -109,10 +110,10 @@
        VBUF_SPACE((bp), (sz)); \
        _ret = snprintf((char *) (bp)->ptr, (bp)->cnt, (fmt), (arg)); \
        if (_ret < 0) \
-           msg_panic("%s: output error for '%s'", myname, (fmt)); \
+           msg_panic("%s: output error for '%s'", myname, mystrdup(fmt)); \
        if (_ret >= (bp)->cnt) \
            msg_panic("%s: output for '%s' exceeds space %ld", \
-                     myname, fmt, (long) (bp)->cnt); \
+                     myname, mystrdup(fmt), (long) (bp)->cnt); \
        VBUF_SKIP(bp); \
     } while (0)
 #else

Reply via email to