From: Rahul Jain Date: Tue, 18 Aug 2020 11:02:24 +0000 (+0530) Subject: added validity check for connection handle X-Git-Tag: submit/tizen/20200901.053326~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F241191%2F2;p=platform%2Fcore%2Fapi%2Fconnection.git added validity check for connection handle if connection handle is null, then _connection_unset_cs_tid() will be crash. Change-Id: Iaba3160becf7b15ea9cec3127e00f1245c767229 --- 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;