From d0cf7fdbb883b4f022b96f8931deac1b29b9b47f Mon Sep 17 00:00:00 2001 From: bol-van Date: Sat, 23 Mar 2024 11:30:46 +0300 Subject: [PATCH] tpws: fix crash when tampering is applied without remote end --- tpws/tamper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpws/tamper.c b/tpws/tamper.c index 6eb7541..e93b5ca 100644 --- a/tpws/tamper.c +++ b/tpws/tamper.c @@ -248,7 +248,7 @@ void tamper_out(t_ctrack *ctrack, uint8_t *segment,size_t segment_buffer_size,si default: break; } - if (tpos) + if (tpos && (5+*size)<=segment_buffer_size) { // construct 2 TLS records from one uint16_t l = pntoh16(segment+3); // length