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)
Thu, Oct 1, 1:39 PM
Unknown Object (File)
Tue, Sep 29, 11:17 AM
Unknown Object (File)
Tue, Sep 22, 5:58 AM
Unknown Object (File)
Tue, Sep 22, 5:48 AM
Unknown Object (File)
Tue, Sep 22, 2:11 AM
Unknown Object (File)
Sep 7 2026, 11:47 AM
Unknown Object (File)
Sep 4 2026, 9:05 PM
Unknown Object (File)
Aug 23 2026, 12:32 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