[cslip]: Add support for cslip example#891
[cslip]: Add support for cslip example#891david-cermak wants to merge 1 commit intoespressif:masterfrom
Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| int len = uart_read_bytes(modem->uart.uart_dev, modem->buffer, modem->buffer_len, 1 / portTICK_PERIOD_MS); | ||
|
|
||
| if (len > 0) { | ||
| modem->buffer[len] = '\0'; |
There was a problem hiding this comment.
Bug: UART RX Task Buffer Overflow Risk
In cslip_modem_uart_rx_task, writing modem->buffer[len] = '\0' can cause a buffer overflow. If uart_read_bytes returns modem->buffer_len bytes, this writes one byte past the allocated buffer boundary. Additionally, null-terminating SLIP-encoded binary data is generally not appropriate for this buffer.
| lwip_netif->output_ip6(lwip_netif, &p, NULL); | ||
| #else | ||
| lwip_netif->output(lwip_netif, &p, NULL); | ||
| #endif |
There was a problem hiding this comment.
Bug: Stack Allocation Bypasses lwIP Memory Management
The pbuf struct is allocated on the stack and only partially initialized, bypassing lwIP's memory management. Critical fields like type, flags, and ref are left uninitialized. Passing this pbuf to lwip_netif->output functions may lead to undefined behavior or memory corruption.
Support for CSLIP netif IDF-4118