Page MenuHomeFreeBSD

remove heuristic error detection from ddi_strto*()
ClosedPublic

Authored by avg on Oct 2 2017, 12:19 PM.
Tags
None
Referenced Files
F110778208: D12565.id33629.diff
Sun, Feb 23, 12:34 AM
Unknown Object (File)
Wed, Jan 29, 11:35 PM
Unknown Object (File)
Wed, Jan 29, 8:57 PM
Unknown Object (File)
Jan 19 2025, 5:17 PM
Unknown Object (File)
Jan 9 2025, 12:33 PM
Unknown Object (File)
Nov 28 2024, 8:14 AM
Unknown Object (File)
Oct 28 2024, 12:07 PM
Unknown Object (File)
Oct 28 2024, 12:07 PM
Subscribers

Details

Summary

Zero, <TYPE>_MIN and <TYPE>_MAX values can result from valid conversions.
They don't necessarily signal any error.
Since we do not have any reliable error signalling from libkern's strto*(),
it's better to always assume success rather than to report an error when
there is none.

@tsoome suggested that for strtol and strtoul we can internally use
strtoq and strtouq, so that we can check a result for being within
the corresponding ranges. Not sure if it's worth the trouble.
There is no equivalent technique for strtoll and strtoull anyway.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

FWIW, this Oracle manual mentions only EINVAL because of an invalid conversion base.

This revision is now accepted and ready to land.Oct 2 2017, 2:11 PM
This revision was automatically updated to reflect the committed changes.