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)
Sun, Nov 16, 1:47 AM
Unknown Object (File)
Sat, Nov 15, 7:25 PM
Unknown Object (File)
Sun, Nov 2, 10:55 PM
Unknown Object (File)
Oct 28 2025, 10:52 PM
Unknown Object (File)
Oct 22 2025, 2:14 PM
Unknown Object (File)
Oct 22 2025, 2:14 PM
Unknown Object (File)
Oct 22 2025, 1:33 AM
Unknown Object (File)
Oct 9 2025, 2:47 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