[Issue 22001] Equality of std.conv.toChars() results for radix 10 depends on uninitialized bytes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 7 23:25:16 UTC 2021


Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/phobos pull request #8133 "std.conv: Avoid undefined bytes in toChars()
results for radix 10" was merged into master:

- ec615eac50b6596cfeed3394d301301657c1ebfa by Martin Kinkelin:
  Fix Issue 22001 - Avoid undefined bytes in std.conv.toChars() results for
radix 10

  The buffer is initialized from right-to-left in initialize(), and unused
  bytes are left alone. Previously, the whole result wasn't preinitialized
  with T.init, so the unused buffer bytes weren't well-defined. Initialize
  it now (with zeros), as the whole buffer is still used for equality/
  identity comparisons etc.



More information about the Digitalmars-d-bugs mailing list