Page MenuHomeFreeBSD

gstat: Set errno = 0 before strtoul
ClosedPublic

Authored by cperciva on Sat, Aug 29, 8:29 PM.
Tags
None
Referenced Files
F170983722: D59270.id.diff
Tue, Sep 8, 12:30 AM
F170982544: D59270.id185517.diff
Tue, Sep 8, 12:21 AM
F170981368: D59270.diff
Tue, Sep 8, 12:11 AM
F170956609: D59270.id185422.diff
Mon, Sep 7, 8:43 PM
F170954674: D59270.id185422.diff
Mon, Sep 7, 8:26 PM
F170945200: D59270.id185422.diff
Mon, Sep 7, 6:57 PM
F170935641: D59270.id185517.diff
Mon, Sep 7, 5:27 PM
F170934081: D59270.id185422.diff
Mon, Sep 7, 5:12 PM
Subscribers

Details

Summary

The strtoul function sets errno on error, but does not clear it on
success; when using strtoul and checking errno (as one should) for
ERANGE / EINVAL afterwards, it's important to zero errno first.

While here, remove a dead store.

Fixes: 4fe8c1b67be0 ("Add error and range checking ... ")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable