Skip to content

Commit

Permalink
[tcp] Fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed May 8, 2012
1 parent e844297 commit 52dd4ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net/tcp.c
Expand Up @@ -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 );
Expand Down

0 comments on commit 52dd4ba

Please sign in to comment.