mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-25 17:58:46 +00:00
fix(ringbuf): xRingbufferReceive() crashes for allow-split buffers
This commit adds an assert check to xRingbufferReceive() and xRingbufferReceiveFromISR() functions to prevent them from being used to retrieve items from an allow-split buffer. Corresponding documentation has also been updated.
This commit is contained in:
@@ -1112,6 +1112,7 @@ void *xRingbufferReceive(RingbufHandle_t xRingbuffer, size_t *pxItemSize, TickTy
|
||||
|
||||
//Check arguments
|
||||
configASSERT(pxRingbuffer && pxItemSize);
|
||||
configASSERT((pxRingbuffer->uxRingbufferFlags & rbALLOW_SPLIT_FLAG) == 0); // This function must not be called for allow-split buffers
|
||||
|
||||
//Attempt to retrieve an item
|
||||
void *pvTempItem;
|
||||
@@ -1128,6 +1129,7 @@ void *xRingbufferReceiveFromISR(RingbufHandle_t xRingbuffer, size_t *pxItemSize)
|
||||
|
||||
//Check arguments
|
||||
configASSERT(pxRingbuffer && pxItemSize);
|
||||
configASSERT((pxRingbuffer->uxRingbufferFlags & rbALLOW_SPLIT_FLAG) == 0); // This function must not be called for allow-split buffers
|
||||
|
||||
//Attempt to retrieve an item
|
||||
void *pvTempItem;
|
||||
|
Reference in New Issue
Block a user