Sitelet https://github.com/ubjson/universal-binary-json/issues/118
Skip to content

Negative lengths for strings or containers #118

Description

@to-miz

The specification doesn't say how to handle negative values in lengths. I propose that it should be handeled as an error, but this needs to be specified, otherwise parsers will disagree on how to handle this case.

I checked a couple of C/C++ libraries, and they seem to silently cast the value to a size_t and allocating memory, resulting in either crashes or errors. The missing specification seems to have resulted in unsafe implementations.

Activity

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

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