Browse Source

[tcp] Fix potential NULL pointer dereference

Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
52dd4bacad
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/tcp.c

+ 1
- 1
src/net/tcp.c View File

1143
 	flags = tcphdr->flags;
1143
 	flags = tcphdr->flags;
1144
 	tcp_rx_opts ( tcp, ( ( ( void * ) tcphdr ) + sizeof ( *tcphdr ) ),
1144
 	tcp_rx_opts ( tcp, ( ( ( void * ) tcphdr ) + sizeof ( *tcphdr ) ),
1145
 		      ( hlen - sizeof ( *tcphdr ) ), &options );
1145
 		      ( hlen - sizeof ( *tcphdr ) ), &options );
1146
-	if ( options.tsopt )
1146
+	if ( tcp && options.tsopt )
1147
 		tcp->ts_val = ntohl ( options.tsopt->tsval );
1147
 		tcp->ts_val = ntohl ( options.tsopt->tsval );
1148
 	iob_pull ( iobuf, hlen );
1148
 	iob_pull ( iobuf, hlen );
1149
 	len = iob_len ( iobuf );
1149
 	len = iob_len ( iobuf );

Loading…
Cancel
Save