Page MenuHomeFreeBSD

sys/getenv: Fix getenv_uint64 to properly handle high set bit
Needs ReviewPublic

Authored by jhibbits on Mar 13 2025, 4:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 14, 9:13 PM
Unknown Object (File)
Mon, Apr 7, 5:27 PM
Unknown Object (File)
Sun, Apr 6, 2:09 PM
Unknown Object (File)
Sun, Mar 30, 11:17 AM
Unknown Object (File)
Mar 16 2025, 4:07 PM
Unknown Object (File)
Mar 14 2025, 2:36 AM
Unknown Object (File)
Mar 14 2025, 2:32 AM
Unknown Object (File)
Mar 14 2025, 12:54 AM
Subscribers

Details

Reviewers
jhb
imp
Summary

strtoq() handles a signed value, so any value with the high bit set will
be treated as negative, and be clamped. Fix this by adding a new
getenv_uquad(), analogue to getenv_quad(), which uses strtouq() instead
of strtoq(). getenv_array() needs more work to deal with uint64_t, and
will be fixed later as needed.

Sponsored by: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62904
Build 59788: arc lint + arc unit