slirp: Fix error reported by static code analysis
Report from smatch: slirp/tcp_subr.c:127 tcp_respond(17) error: we previously assumed 'tp' could be null (see line 124) Return if 'tp' is NULL. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
c4d12a743c
commit
e56afbc54a
|
@ -124,7 +124,7 @@ tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m,
|
||||||
if (tp)
|
if (tp)
|
||||||
win = sbspace(&tp->t_socket->so_rcv);
|
win = sbspace(&tp->t_socket->so_rcv);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
if ((m = m_get(tp->t_socket->slirp)) == NULL)
|
if (!tp || (m = m_get(tp->t_socket->slirp)) == NULL)
|
||||||
return;
|
return;
|
||||||
tlen = 0;
|
tlen = 0;
|
||||||
m->m_data += IF_MAXLINKHDR;
|
m->m_data += IF_MAXLINKHDR;
|
||||||
|
|
Loading…
Reference in New Issue