summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhipeng Xue <543984341@qq.com>2023-03-05 05:12:04 +0800
committerGitHub <noreply@github.com>2023-03-04 22:12:04 +0100
commitfa05966d74810ed1bc5c3f0ace83ba31b9225735 (patch)
tree29a40afc71be2e51f5785cdf6b72d388d666c623
parent557990cad33f1b06a1e2a416231d79590237dd2e (diff)
downloadlibevent-fa05966d74810ed1bc5c3f0ace83ba31b9225735.tar.gz
test: fix potential null dereference in https_bind_ssl_bevcb (#1428)
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
-rw-r--r--test/regress_http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/regress_http.c b/test/regress_http.c
index 3b6f7ba2..626908c6 100644
--- a/test/regress_http.c
+++ b/test/regress_http.c
@@ -4318,6 +4318,10 @@ https_bind_ssl_bevcb(struct evhttp *http, ev_uint16_t port, ev_uint16_t *pport,
int _port;
struct evhttp_bound_socket *sock = NULL;
sock = evhttp_bind_socket_with_handle(http, "127.0.0.1", port);
+ if (!sock) {
+ event_errx(1, "Couldn't open web port");
+ return -1;
+ }
#ifdef EVENT__HAVE_OPENSSL
if (mask & HTTP_OPENSSL) {