From 0f2db6c2479639722f8c6c7f3fc37cc78f5e6bb3 Mon Sep 17 00:00:00 2001 From: dartvader316 Date: Mon, 5 Aug 2024 22:17:48 +0300 Subject: [PATCH] correct htons_pad2 --- packets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packets.c b/packets.c index 7e49dd5..d3caa34 100644 --- a/packets.c +++ b/packets.c @@ -140,7 +140,7 @@ int change_tls_sni(const char *host, char *buffer, size_t bsize) uint16_t htons_sni2 = htons(old_sz + diff + 5); uint16_t htons_sni4 = htons(old_sz + diff + 3); uint16_t htons_sni7 = htons(old_sz + diff); - uint16_t htons_pad2 = htons(old_sz - diff); + uint16_t htons_pad2 = htons(free_sz - diff); memcpy(sni + 2, &htons_sni2, sizeof(htons_sni2)); memcpy(sni + 4, &htons_sni4, sizeof(htons_sni4)); memcpy(sni + 7, &htons_sni7, sizeof(htons_sni7));