]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: payload: remove dead code in smp_client_hello_parse()
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 18 Aug 2026 14:27:34 +0000 (14:27 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 18 Aug 2026 14:28:35 +0000 (16:28 +0200)
Remove dead code reported by Coverity (CID 1660132, GH #3471). bleft
is already guaranteed to be >= hs_len >= 49 by the two preceding
checks (bleft < 5 / hs_len < 49 / bleft < hs_len), so the
`if (bleft < 1)` check right after can never be true.

src/payload.c

index 8e1df72cf7609381ce3f614550dc061843b5ec8a..fe88fea9b456e72ef98e5657f97733155521e733 100644 (file)
@@ -120,8 +120,6 @@ smp_client_hello_parse( struct sample *smp, enum client_hello_type type, unsigne
                goto too_short;
 
        /* Check for a complete client hello starting at <data> */
-       if (bleft < 1)
-               goto too_short;
        if (data[0] != 0x01) /* msg_type = Client Hello */
                goto not_ssl_hello;