mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-18 20:10:53 +00:00
fixed bug #41499 netconn::recv_avail can overflow
This commit is contained in:
parent
08b56e8180
commit
a2d6a50dff
@ -96,6 +96,9 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2014-02-20: Simon Goldschmidt
|
||||||
|
* api.h, sockets.c: fixed bug #41499 netconn::recv_avail can overflow
|
||||||
|
|
||||||
2014-01-08: Stathis Voukelatos
|
2014-01-08: Stathis Voukelatos
|
||||||
* memp_std.h: patch #7928 Fixed size calculation in MALLOC memory pool
|
* memp_std.h: patch #7928 Fixed size calculation in MALLOC memory pool
|
||||||
creation macro
|
creation macro
|
||||||
|
@ -2521,7 +2521,7 @@ lwip_ioctl(int s, long cmd, void *argp)
|
|||||||
u8_t val;
|
u8_t val;
|
||||||
#if LWIP_SO_RCVBUF
|
#if LWIP_SO_RCVBUF
|
||||||
u16_t buflen = 0;
|
u16_t buflen = 0;
|
||||||
s16_t recv_avail;
|
int recv_avail;
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
#endif /* LWIP_SO_RCVBUF */
|
||||||
|
|
||||||
if (!sock) {
|
if (!sock) {
|
||||||
@ -2565,7 +2565,7 @@ lwip_ioctl(int s, long cmd, void *argp)
|
|||||||
if (recv_avail < 0) {
|
if (recv_avail < 0) {
|
||||||
recv_avail = 0;
|
recv_avail = 0;
|
||||||
}
|
}
|
||||||
*((u16_t*)argp) = (u16_t)recv_avail;
|
*((int*)argp) = recv_avail;
|
||||||
|
|
||||||
/* Check if there is data left from the last recv operation. /maq 041215 */
|
/* Check if there is data left from the last recv operation. /maq 041215 */
|
||||||
if (sock->lastdata) {
|
if (sock->lastdata) {
|
||||||
|
@ -203,7 +203,7 @@ struct netconn {
|
|||||||
/** number of bytes currently in recvmbox to be received,
|
/** number of bytes currently in recvmbox to be received,
|
||||||
tested against recv_bufsize to limit bytes on recvmbox
|
tested against recv_bufsize to limit bytes on recvmbox
|
||||||
for UDP and RAW, used for FIONREAD */
|
for UDP and RAW, used for FIONREAD */
|
||||||
s16_t recv_avail;
|
int recv_avail;
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
#endif /* LWIP_SO_RCVBUF */
|
||||||
/** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */
|
/** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */
|
||||||
u8_t flags;
|
u8_t flags;
|
||||||
|
Loading…
Reference in New Issue
Block a user