Skip to content

Invalid string construction #57133

Open
@PJBoy

Description

return ThrowInvalidURL(realm->env(), input.ToStringView(), nullptr);

ThrowInvalidURL takes an std::optional<std::string> as third parameter. Passing nullptr constructs a std::string from that null pointer, this is undefined behaviour (upgraded to ill-formed in C++23). At a glance, it would seem that std::nullopt was the intended third argument.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions