On Mon, Apr 13, 2026 at 02:36:17PM +0000, Egor Shestakov wrote:
> > > > diff --git a/src/acme.c b/src/acme.c
> > > > index eb7137b4c..437528c08 100644
> > > > --- a/src/acme.c
> > > > +++ b/src/acme.c
> > > > @@ -800,8 +800,8 @@ static int cfg_postsection_acme()
> > > >         /* tries to open the account key  */
> > > >         if (stat(path, &st) == 0) {
> > > >                 if (ssl_sock_load_key_into_ckch(path, NULL, 
> > > > store->data, &errmsg)) {
> > > > -                       memprintf(&errmsg, "%s'%s' is present but 
> > > > cannot be read or parsed.\n", errmsg && *errmsg ? errmsg : NULL, path);
> > > > -                       if (errmsg && *errmsg)
> > > > +                       memprintf(&errmsg, "%s'%s' is present but 
> > > > cannot be read or parsed.\n", errmsg, path);
> > > > +                       if (errmsg)
> > > >                                 indent_msg(&errmsg, 8);
> > > >                         err_code |= ERR_ALERT | ERR_FATAL | ERR_ABORT;
> > > >                         ha_alert("acme: %s\n", errmsg);
> > > 
> > > In my opinion this first part should be in a separate BUG/MINOR patch 
> > > which
> > > should be backported.
> > 
> > Sorry, too late, I just merged it :-(
> 
> Race condition:-)
> 
> > I can revert it and re-apply it as a separate fix if needed, though it's
> > not really important as most of the time it will just print "(null)" for
> > empty messages instead of nothing, though I'm not aware of any command
> > not emitting empty error messages.
> 
> We get the "(null)" in the message in any case (with or without the patch).
> There is not bug. My patch doesn't fix something, it just eliminate an
> uneeded. This is reason why I didn't split it.

Oh you're totally right indeed, I read a bit too fast because I had
found other occurrences doing a specific check. It's not clean to send
a NULL into %s, as "(null)" is GNU and not standard. Here we should
probably use: 'errmsg ? errmsg: ""' like at many other places.

Willy


Reply via email to