ThomasMiz/dust-devil

Undefined behavior in chunk_reader

Opened this issue · 0 comments

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.