packages/net/haproxy/patches/0018-BUG-MINOR-ssl-fix-smp_fetch_ssl_fc_session_id.patch
heil b1cac15063 haproxy: upstream fixes
- [PATCH 15/18] MEDIUM: ssl: replace standards DH groups with custom
 - [PATCH 16/18] BUG/MINOR: debug: display (null) in place of "meth"
 - [PATCH 17/18] CLEANUP: deinit: remove codes for cleaning
 - [PATCH 18/18] BUG/MINOR: ssl: fix smp_fetch_ssl_fc_session_id

Signed-off-by: heil <heil@terminal-consulting.de>
2015-06-22 14:57:26 +02:00

37 lines
1.2 KiB
Diff

From 69760db11dfca4a8d8fbd34cec25c334f77add67 Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Wed, 17 Jun 2015 18:34:14 +0200
Subject: [PATCH 18/18] BUG/MINOR: ssl: fix smp_fetch_ssl_fc_session_id
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.
(cherry picked from commit 745d4127582a8c66e2e8ce35f746a78e867960af)
---
src/ssl_sock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 93aab8b..7d77d36 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -3540,7 +3540,7 @@ smp_fetch_ssl_fc_session_id(struct proxy *px, struct session *l4, void *l7, unsi
return 0;
smp->data.str.str = (char *)SSL_SESSION_get_id(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;
--
2.3.6