[PATCH] dropbear-051: errno bug fix

Matt Johnston matt at ucc.asn.au
Mon Sep 22 23:12:39 WST 2008


On Fri, Sep 19, 2008 at 06:15:41PM -0400, Farrell Aultman wrote:
> The code assumed that when strol is successful, that it will set errno to
> zero.  This is not the case, at least
> under uClinux.  The man page does not indicate this either.  What can happen
> is that errno is already set to non-zero
> before strol is called, then strol is successful but since strol doesn't
> reset errno to zero, the next line thinks that strol failed.

I've applied this now in a more general form with a new
function m_str_to_int(). Funnily enough setting errno=EINVAL isn't
actually defined by C99 - though most (all?) platforms seem
to do that.

Cheers,
Matt


More information about the Dropbear mailing list