tpws: fix crash when tampering is applied without remote end

This commit is contained in:
bol-van 2024-03-23 11:30:46 +03:00
parent 77520d7f8b
commit d0cf7fdbb8

View File

@ -248,7 +248,7 @@ void tamper_out(t_ctrack *ctrack, uint8_t *segment,size_t segment_buffer_size,si
default: default:
break; break;
} }
if (tpos) if (tpos && (5+*size)<=segment_buffer_size)
{ {
// construct 2 TLS records from one // construct 2 TLS records from one
uint16_t l = pntoh16(segment+3); // length uint16_t l = pntoh16(segment+3); // length