Skip to content

read_null_terminated_utf8_string does not check box bounds #157

@mauricefisher64

Description

@mauricefisher64

It is possible for a bad source file to read beyond the end of the box returning a bogus string. This will cause error downstream in areas such as in Emsg reader:

let message_size = size - Self::size_without_message(version, &scheme_id_uri, &value);
let mut message_data = Vec::with_capacity(message_size as usize);
reader.read_exact(&mut message_data)?;

The message will not be able to read correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions