Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
df8b74d6
Unverified
Commit
df8b74d6
authored
Aug 29, 2022
by
Michael Grunder
Committed by
GitHub
Aug 29, 2022
Browse files
Merge pull request #1091 from redis/ssl-error-ub-fix
Fix some undefined behavior
parents
507a6dca
0ed6cdec
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/example-libevent-ssl.c
View file @
df8b74d6
...
...
@@ -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
();
...
...
examples/example-ssl.c
View file @
df8b74d6
...
...
@@ -12,7 +12,7 @@
int
main
(
int
argc
,
char
**
argv
)
{
unsigned
int
j
;
redisSSLContext
*
ssl
;
redisSSLContextError
ssl_error
;
redisSSLContextError
ssl_error
=
REDIS_SSL_CTX_NONE
;
redisContext
*
c
;
redisReply
*
reply
;
if
(
argc
<
4
)
{
...
...
@@ -27,9 +27,8 @@ int main(int argc, char **argv) {
redisInitOpenSSL
();
ssl
=
redisCreateSSLContext
(
ca
,
NULL
,
cert
,
key
,
NULL
,
&
ssl_error
);
if
(
!
ssl
)
{
printf
(
"SSL Context error: %s
\n
"
,
redisSSLContextGetError
(
ssl_error
));
if
(
!
ssl
||
ssl_error
!=
REDIS_SSL_CTX_NONE
)
{
printf
(
"SSL Context error: %s
\n
"
,
redisSSLContextGetError
(
ssl_error
));
exit
(
1
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment