Skip to content

Undefined behavior in chunk_reader #2

@ThomasMiz

Description

@ThomasMiz

While this is currently working fine as is, there is actually UB in this code, in both the read_chunked_utf8_string and the read_domainname function, as calling set_len on a vector before filling up that vector means that area of the vector, which is now considered initialized, is actually uninitialized.

Fix by using Vec::spare_capacity_mut.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions