Page MenuHomeFreeBSD

gstat: Set errno = 0 before strtoul
ClosedPublic

Authored by cperciva on Aug 29 2026, 8:29 PM.
Tags
None
Referenced Files
F174337214: D59270.diff
Fri, Oct 2, 12:25 PM
F174335856: D59270.diff
Fri, Oct 2, 12:10 PM
F174335840: D59270.diff
Fri, Oct 2, 12:10 PM
Unknown Object (File)
Wed, Sep 30, 2:44 PM
Unknown Object (File)
Wed, Sep 30, 10:14 AM
Unknown Object (File)
Wed, Sep 30, 3:33 AM
Unknown Object (File)
Sat, Sep 26, 10:59 PM
Unknown Object (File)
Sat, Sep 26, 8:19 AM
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