forked from Imagelibrary/lwip
sys.h, api_lib.c, api_msg.c, sockets.c: fix bug #21698: "netconn->recv_avail is not protected" by using new macros for interlocked access to modify/test netconn->recv_avail.
This commit is contained in:
@@ -358,7 +358,7 @@ netconn_recv(struct netconn *conn)
|
||||
|
||||
if (p != NULL) {
|
||||
len = p->tot_len;
|
||||
conn->recv_avail -= len;
|
||||
SYS_ARCH_DEC(conn->recv_avail, len);
|
||||
} else {
|
||||
len = 0;
|
||||
}
|
||||
@@ -401,7 +401,7 @@ netconn_recv(struct netconn *conn)
|
||||
sys_arch_mbox_fetch(conn->recvmbox, (void *)&buf, 0);
|
||||
#endif /* LWIP_SO_RCVTIMEO*/
|
||||
if (buf!=NULL) {
|
||||
conn->recv_avail -= buf->p->tot_len;
|
||||
SYS_ARCH_DEC(conn->recv_avail, buf->p->tot_len);
|
||||
/* Register event with callback */
|
||||
API_EVENT(conn, NETCONN_EVT_RCVMINUS, buf->p->tot_len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user