From 0ed6cdec35aa8bb781bd1859c3b4e6b7ec61de10 Mon Sep 17 00:00:00 2001 From: jengab Date: Tue, 8 Jun 2021 08:34:23 +0200 Subject: Fix some undefined behaviour - redisSSLContextError must always be initialized at defintion, otherwise when SSL connect succeeds it may not be assigned to a valid error. Thus the memory trash remains in the variable, which may sign a misleading error. --- examples/example-libevent-ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/example-libevent-ssl.c') diff --git a/examples/example-libevent-ssl.c b/examples/example-libevent-ssl.c index 7d99af1..d0998ba 100644 --- a/examples/example-libevent-ssl.c +++ b/examples/example-libevent-ssl.c @@ -56,7 +56,7 @@ int main (int argc, char **argv) { const char *caCert = argc > 5 ? argv[6] : NULL; redisSSLContext *ssl; - redisSSLContextError ssl_error; + redisSSLContextError ssl_error = REDIS_SSL_CTX_NONE; redisInitOpenSSL(); -- cgit v1.2.3