On Mon, Sep 04, 2017 at 11:38:03PM +1000, Jonathan Gray wrote:
> On Mon, Sep 04, 2017 at 02:39:17PM +0200, Alexander Bluhm wrote:
> > On Wed, Aug 30, 2017 at 09:20:40PM +1000, Jonathan Gray wrote:
> > > @@ -680,8 +680,9 @@ config_getproto(struct relayd *env, stru
> > >   s = sizeof(*proto);
> > >  
> > >   styl = IMSG_DATA_SIZE(imsg) - s;
> > > + proto->style = NULL;
> > >   if (styl > 0) {
> > 
> > I think this chunk is the important part of the bugfix.  The
> > strndup(3) in get_string() creates a correct NUL termination in any
> > case.  A few lines above in config_gettable() I see a simmilar
> > problem.  So I would propose this fix instead.
> 
> This diff retains the problem of style "" giving the default
> instead of an empty style string.

Ah, I see.  Please commit your diff.  OK bluhm@

The tb->sendbuf is correct anyway.  It works slightly different and
calloc(3) clears the pointer there.

bluhm

Reply via email to