net: contiki: Prevent a null dereference
When first starting the board, uip_connr may be NULL. This causes an invalid pointer dereference. Add a NULL check. Change-Id: Ia5d9897038a22fe44aab5106dd6b84c5a358512d Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
This commit is contained in:
parent
37405583d9
commit
0766d3b921
2 changed files with 2 additions and 2 deletions
|
@ -2193,7 +2193,7 @@ uip_process(struct net_buf **buf_out, uint8_t flag)
|
|||
|
||||
#if UIP_TCP
|
||||
/* Clear any pending packet */
|
||||
if (uip_connr->buf) {
|
||||
if (uip_connr && uip_connr->buf) {
|
||||
tcp_cancel_retrans_timer(uip_connr);
|
||||
switch (uip_connr->tcpstateflags & UIP_TS_MASK) {
|
||||
case UIP_FIN_WAIT_1:
|
||||
|
|
|
@ -2577,7 +2577,7 @@ tcp_send_syn:
|
|||
|
||||
#if UIP_TCP
|
||||
/* Clear any pending packet */
|
||||
if (uip_connr->buf) {
|
||||
if (uip_connr && uip_connr->buf) {
|
||||
tcp_cancel_retrans_timer(uip_connr);
|
||||
switch (uip_connr->tcpstateflags & UIP_TS_MASK) {
|
||||
case UIP_FIN_WAIT_1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue