From fa02d94d30f58139aa327cf92bae56e1ddd573b7 Mon Sep 17 00:00:00 2001 From: Pavel Shliak Date: Fri, 20 Dec 2024 02:37:45 +0400 Subject: [PATCH] LibTLS: Remove unreachable buffer length check Refer to the while condition --- Libraries/LibTLS/Handshake.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Libraries/LibTLS/Handshake.cpp b/Libraries/LibTLS/Handshake.cpp index 72f5993d966..0c2d42b1bee 100644 --- a/Libraries/LibTLS/Handshake.cpp +++ b/Libraries/LibTLS/Handshake.cpp @@ -257,8 +257,6 @@ ssize_t TLSv12::handle_handshake_payload(ReadonlyBytes vbuffer) auto original_length = buffer_length; while (buffer_length >= 4 && !m_context.critical_error) { ssize_t payload_res = 0; - if (buffer_length < 1) - return (i8)Error::NeedMoreData; auto type = static_cast(buffer[0]); auto write_packets { WritePacketStage::Initial }; size_t payload_size = buffer[1] * 0x10000 + buffer[2] * 0x100 + buffer[3] + 3;