diff options
author | Robin Gareus <robin@gareus.org> | 2014-03-23 00:04:46 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-03-23 00:04:46 +0100 |
commit | 679d48ee2b4f08b34481a1c59208421621bf60d1 (patch) | |
tree | 12602a53f27f6c30233f9c01127ef65b8f4541a2 /libs/ardour/worker.cc | |
parent | a87a71f05ff71ee2e581bc32af1be218344c5b1f (diff) |
fix edge case (partial write of LV2 worker message size)
Diffstat (limited to 'libs/ardour/worker.cc')
-rw-r--r-- | libs/ardour/worker.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/ardour/worker.cc b/libs/ardour/worker.cc index d5238adb60..b110dc286f 100644 --- a/libs/ardour/worker.cc +++ b/libs/ardour/worker.cc @@ -82,6 +82,9 @@ Worker::verify_message_completeness(RingBuffer<uint8_t>* rb) uint32_t size; RingBuffer<uint8_t>::rw_vector vec; rb->get_read_vector (&vec); + if (vec.len[0] + vec.len[1] < sizeof(size)) { + return false; + } if (vec.len[0] >= sizeof(size)) { memcpy (&size, vec.buf[0], sizeof (size)); } else { |