]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: fix smp_fetch_ssl_fc_session_id
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2015 16:34:14 +0000 (18:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2015 17:46:14 +0000 (19:46 +0200)
Dmitry Sivachenko reported the following build warning using Clang
which is a real bug :

src/ssl_sock.c:4104:44: warning: address of 'smp->data.str.len' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
        if (!smp->data.str.str || !&smp->data.str.len)

The impact is very low however, it will return an empty session_id
instead of no session id when none is found.

The fix should be backported to 1.5.

src/ssl_sock.c

index 133a705e7a05e3ff4bce10c420a2519cd2893e68..dcbef4c574b83f4f584643a08af905e4af3edda8 100644 (file)
@@ -4101,7 +4101,7 @@ smp_fetch_ssl_fc_session_id(const struct arg *args, struct sample *smp, const ch
                return 0;
 
        smp->data.str.str = (char *)SSL_SESSION_get_id(ssl_sess, (unsigned int *)&smp->data.str.len);
-       if (!smp->data.str.str || !&smp->data.str.len)
+       if (!smp->data.str.str || !smp->data.str.len)
                return 0;
 
        return 1;