mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 14:04:46 -04:00
SDRDaemoFEC plugin: fixed possible segfault
This commit is contained in:
@@ -402,6 +402,11 @@ uint8_t *SDRdaemonFECBuffer::readData(int32_t length)
|
||||
|
||||
m_nbReads++;
|
||||
|
||||
// SEGFAULT FIX: arbitratily truncate so that it does not exceed buffer length
|
||||
if (length > framesSize) {
|
||||
length = framesSize;
|
||||
}
|
||||
|
||||
if (m_readIndex + length < m_framesNbBytes) // ends before buffer bound
|
||||
{
|
||||
m_readIndex += length;
|
||||
|
||||
Reference in New Issue
Block a user