Skip to content

String::concat(char*, size_t) doesn't support non-null terminated views #8200

Closed
@paulocsanz

Description

@paulocsanz

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Problem Description

If a non-null terminated char* view (like std::array<char, 32> md5 as storage) is passed to String::concat it currently crashes, because it's triggering UB by reading after the end of the buffer. This is the only way the current String API could allow adding a non-null terminated string to String, all the rest depends on strlen. So it's kinda important to the non-null terminated view use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions