From: Michael Brown Date: Tue, 8 May 2012 11:47:51 +0000 (+0100) Subject: [tcp] Fix potential NULL pointer dereference X-Git-Tag: v1.20.1~1807 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52dd4bacadb1ec45ecc66abe4ee6bd17fe07e66f;p=thirdparty%2Fipxe.git [tcp] Fix potential NULL pointer dereference Detected using Valgrind. Signed-off-by: Michael Brown --- diff --git a/src/net/tcp.c b/src/net/tcp.c index 0a7924a71..5a9810b2c 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -1143,7 +1143,7 @@ static int tcp_rx ( struct io_buffer *iobuf, flags = tcphdr->flags; tcp_rx_opts ( tcp, ( ( ( void * ) tcphdr ) + sizeof ( *tcphdr ) ), ( hlen - sizeof ( *tcphdr ) ), &options ); - if ( options.tsopt ) + if ( tcp && options.tsopt ) tcp->ts_val = ntohl ( options.tsopt->tsval ); iob_pull ( iobuf, hlen ); len = iob_len ( iobuf );