# Need stronger protection? Integer overflow in xStreamBufferSend() for message buffers — v10.6.2 is configASSERT-only protection

**URL:** <https://forums.freertos.org/t/need-stronger-protection-integer-overflow-in-xstreambuffersend-for-message-buffers-v10-6-2-is-configassert-only-protection/24944>\
**Category:** Kernel\
**Tags:** debug\
**Created:** [April 11, 2026, 6:12am UTC](https://forums.freertos.org/t/need-stronger-protection-integer-overflow-in-xstreambuffersend-for-message-buffers-v10-6-2-is-configassert-only-protection/24944 "2026-04-11T06:12:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuzzrt26](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/fuzzrt26/32/6192_2.png) [@fuzzrt26](https://forums.freertos.org/u/fuzzrt26)\
**Post date:** [April 11, 2026, 6:12am UTC](https://forums.freertos.org/t/need-stronger-protection-integer-overflow-in-xstreambuffersend-for-message-buffers-v10-6-2-is-configassert-only-protection/24944/1 "2026-04-11T06:12:48Z")

</div>

## Description

In `stream_buffer.c`, the function `xStreamBufferSend()` (also invoked via the `xMessageBufferSend()` macro) adds `sbBYTES_TO_STORE_MESSAGE_LENGTH` to `xRequiredSpace` without a runtime overflow check. The only protection is a `configASSERT`, which is compiled out in release builds.

With the analysis help of AI, it says “this is the same class of integer overflow vulnerability that was fixed in `xStreamBufferGenericCreate()` (CVE-2021-31572), but the fix was not applied to the send path.”

## Affected Version

FreeRTOS Kernel V10.6.2.

## Location

`stream_buffer.c`, inside `xStreamBufferSend()`:

```c
// Line ~677
size_t xRequiredSpace = xDataLengthBytes;

// Line ~692-697
if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) != ( uint8_t ) 0 )
{
    xRequiredSpace += sbBYTES_TO_STORE_MESSAGE_LENGTH; // <-- can wrap on 32-bit

    /* Overflow? */
    configASSERT( xRequiredSpace > xDataLengthBytes ); // <-- ONLY protection
    ...
}
```

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [April 11, 2026, 4:21pm UTC](https://forums.freertos.org/t/need-stronger-protection-integer-overflow-in-xstreambuffersend-for-message-buffers-v10-6-2-is-configassert-only-protection/24944/2 "2026-04-11T16:21:30Z")

</div>

Combining threads: [Integer overflow in xStreamBufferSendFromISR() for message buffers — no overflow check - V10.6.2 - #2 by rtel](https://forums.freertos.org/t/integer-overflow-in-xstreambuffersendfromisr-for-message-buffers-no-overflow-check-v10-6-2/24946/2)

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [April 13, 2026, 5:31am UTC](https://forums.freertos.org/t/need-stronger-protection-integer-overflow-in-xstreambuffersend-for-message-buffers-v10-6-2-is-configassert-only-protection/24944/3 "2026-04-13T05:31:23Z")

</div>

Closed on April 13, 2026, 5:31am UTC


