2
0
mirror of https://github.com/xcat2/xNBA.git synced 2025-02-06 22:11:57 +00:00

[tcp] Fix potential NULL pointer dereference

Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2012-05-08 12:47:51 +01:00
parent e844297ef6
commit 52dd4bacad

View File

@ -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 );