mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-22 01:17:04 +00:00
Fix segfault by OOB read on malformed packets (2)
This commit is contained in:
parent
cebce341c5
commit
55510f8fb1
1 changed files with 6 additions and 1 deletions
|
@ -242,7 +242,12 @@ static int process_data_segment(conn,handler,p,stream,direction)
|
|||
long l;
|
||||
|
||||
l=p->len - p->tcp->th_off * 4;
|
||||
|
||||
|
||||
if(l < 0) {
|
||||
printf("Malformed packet, computed TCP segment size is negative, skipping ...\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(stream->close){
|
||||
DBG((0,"Rejecting packet received after FIN: %u:%u(%u)",
|
||||
ntohl(p->tcp->th_seq),ntohl(p->tcp->th_seq+l),l));
|
||||
|
|
Loading…
Reference in a new issue