summaryrefslogtreecommitdiff
path: root/slirp
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-09-04 23:20:36 +0200
committerJan Kiszka <jan.kiszka@siemens.com>2012-09-13 12:38:14 +0200
commite56afbc54a2132c56931f44bae1992c28119944f (patch)
tree273ecb5aa08426332d4a7626b8dc9a179307fc8a /slirp
parentc4d12a743c73a5b88a8705ca68ff620ce0f8bba7 (diff)
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>
Diffstat (limited to 'slirp')
-rw-r--r--slirp/tcp_subr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 5890d7a827..1542e43619 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -124,7 +124,7 @@ tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m,
if (tp)
win = sbspace(&tp->t_socket->so_rcv);
if (m == NULL) {
- if ((m = m_get(tp->t_socket->slirp)) == NULL)
+ if (!tp || (m = m_get(tp->t_socket->slirp)) == NULL)
return;
tlen = 0;
m->m_data += IF_MAXLINKHDR;