cginternals / cginternals/glbinding

RingBuffer::resize() issues

Open
#270 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
877
Forks
95
PR merge metrics
No merged PRs in 30d

Description

Looking into `Ringbuffer.inl` I noticed that Ringbuffer::resize() simply resizes the internal buffer without any additional checks concerning head and tails. Resizing, especially shrinking a Ringbuffer after it was already used can have results ranging from loss or duplication of entries to crashes due to runtime errors. In short, shrinking a buffer such that the head or the tails are left at invalid (too high) indices should be avoided.

Currently, the RingBuffer is used for logging in glbinding-aux, and resizing this buffer is exposed in `logging.h`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.