From c4d219e811fcd6d550420a32fc6566488c8896d9 Mon Sep 17 00:00:00 2001 From: Rahul Jain Date: Tue, 18 Aug 2020 16:32:24 +0530 Subject: [PATCH] added validity check for connection handle if connection handle is null, then _connection_unset_cs_tid() will be crash. Change-Id: Iaba3160becf7b15ea9cec3127e00f1245c767229 --- src/connection.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/connection.c b/src/connection.c index a00868f..fe594bb 100755 --- a/src/connection.c +++ b/src/connection.c @@ -233,6 +233,14 @@ EXPORT_API int connection_destroy_cs(int tid, connection_h connection) int rv; CONN_LOCK; + + if (!(__connection_check_handle_validity(connection))) { + CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter"); + CONN_UNLOCK; + return CONNECTION_ERROR_INVALID_PARAMETER; + } + + CONNECTION_LOG(CONNECTION_INFO, "Destroy connection handle: %p", connection); _connection_unset_cs_tid(tid, connection); CONN_UNLOCK; -- 2.7.4