Skip to content

One more place of UB #26

@mcourteaux

Description

@mcourteaux

if (b->first + newsize > b->capacity)
buffer_reserve(b, (newsize * 3) / 2);

should be:

if (!b->first || b->first + newsize > b->capacity)

I know it's annoying, because it sort of is super-correct if you just ignore the fact that it is defined as undefined behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions