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)
Tue, Aug 4, 6:12 AM
Unknown Object (File)
Mon, Aug 3, 1:02 AM
Unknown Object (File)
Sun, Aug 2, 5:25 AM
Unknown Object (File)
Fri, Jul 31, 4:59 PM
Unknown Object (File)
Sun, Jul 26, 4:02 PM
Unknown Object (File)
Thu, Jul 23, 10:30 AM
Unknown Object (File)
Sat, Jul 18, 2:19 PM
Unknown Object (File)
Sat, Jul 18, 12:49 PM
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