Fix possible ringbuffer overflow

This commit is contained in:
David Robillard 2016-07-31 20:06:51 -04:00
parent 96511688a1
commit 4805747260

View file

@ -63,7 +63,7 @@ Worker::schedule(uint32_t size, const void* data)
bool
Worker::respond(uint32_t size, const void* data)
{
if (_requests->write_space() < size + sizeof(size)) {
if (_responses->write_space() < size + sizeof(size)) {
return false;
}
if (_responses->write((const uint8_t*)&size, sizeof(size)) != sizeof(size)) {