Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[BUG] Bytes to string conversion function does not error for invalid code points #716

Copy link
Copy link

Description

@timostamm
Issue body actions

Describe the bug

According to the language definition,

string(bytes) -> string converts a byte sequence to a UTF-8 string, errors for invalid code points.

However, cel-java does not error for invalid code points.

To Reproduce

string(b"\xff")

Expected behavior

I would expect a runtime error, but the expression evaluates to "�" instead.

Additional context

bytes_to_string calls ByteString::toStringUtf8. It should probably check ByteString::isValidUtf8 first, and raise an error if that returns false.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.