]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer-ssl: fix use-after-free (CID 1433623)
authorMats Klepsland <mats.klepsland@gmail.com>
Wed, 28 Mar 2018 20:29:15 +0000 (22:29 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 29 Mar 2018 11:16:52 +0000 (13:16 +0200)
Ja3BufferAddValue frees the buffer on error, so there is no point
in doing it twice (use-after-free).

src/app-layer-ssl.c

index c89bd369e9d2460cf39a5b386769bc1871a96b2b..0f290e93d306f5e0d4bdb1a886a75ecc7a40bb08 100644 (file)
@@ -660,7 +660,6 @@ static inline int TLSDecodeHSHelloCipherSuites(SSLState *ssl_state,
             if (TLSDecodeValueIsGREASE(cipher_suite) != 1) {
                 rc = Ja3BufferAddValue(ja3_cipher_suites, cipher_suite);
                 if (rc != 0) {
-                    Ja3BufferFree(&ja3_cipher_suites);
                     return -1;
                 }
             }