# arena_allocator/reset: fix buffer overrun · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/41430a366f75eb7301deaca91d4aea3bbf61c8ec)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 41430a366f75eb7301deaca91d4aea3bbf61c8ec

Requested commit: 41430a366f75eb7301deaca91d4aea3bbf61c8ec

Commit: 41430a366f75eb7301deaca91d4aea3bbf61c8ec

Tree: bf2c9415996623fa9b9d41329ce0dcb3631d3b22

Author: Erik Arvstedt

Committer: Erik Arvstedt

## Message

```
arena_allocator/reset: fix buffer overrun

Previously, the buffer reserved with `retain_with_limit` was missing
space for the `BufNode`.

When the user-provided a limit that was smaller than `@sizeOf(BufNode)`,
`reset` would store a new `BufNode` in an allocation smaller than
`BufNode`, leading to a buffer overrun.

```

## Parents

- [c16d4ab9e41be6b5c560d15eaa145ff3a0ffce6c](https://git.cafe/gitcafe/zig/commit/c16d4ab9e41be6b5c560d15eaa145ff3a0ffce6c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/41430a366f75eb7301deaca91d4aea3bbf61c8ec?format=markdown)
