Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

[C++] Why there is no error handling on out-bound skip of InputBuffer? #1158

@SleepyBag

Description

@SleepyBag

Here is the code of InputBuffer::Skip:

    void Skip(uint32_t size)
    {
        if (size > _blob.length() - _pointer)
        {
            return;
        }

        _pointer += size;
    }

It can be seen that when the size is too large, it simply does nothing - neither throw an exception nor return a fail code. Is this behavior by design? Given that the _pointer member is protected, there is no way we can know if the skip success after calling it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions