Skip to content

[BUG] Radix Integer Formatter Incorrectly Uses Uninitialized Memory #126

@Alexhuszagh

Description

@Alexhuszagh

Description

When using MaybeUninit::uninit, the radix writer converts this then to a &mut [u8], which is fine as long as the memory is read, however, all assignments are done via read/writes and not pointer writes. Since these formatters require copying to a temporary buffer anyway, it's very unlikely the use of a zero-initialized vs. a maybe unitialized buffer will cause major performance enhancements.

let mut digits: mem::MaybeUninit<[u8; 64]> = mem::MaybeUninit::uninit();

unsafe { index_unchecked_mut!($bytes[$index] = $table[$r + 1]) };

Metadata

Metadata

Assignees

Labels

A-secIssues with potential security implications.bugSomething isn't workinghigh priorityHigh priority

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions