fix invalid conn

This commit is contained in:
yihaoDeng 2022-06-05 23:01:48 +08:00
parent b375531ade
commit 72657a3f60
1 changed files with 4 additions and 0 deletions

View File

@ -1160,6 +1160,10 @@ int transGetConnInfo(void* thandle, STransHandleInfo* pInfo) {
} }
SExHandle* ex = thandle; SExHandle* ex = thandle;
SSvrConn* pConn = ex->handle; SSvrConn* pConn = ex->handle;
if (pConn == NULL) {
tTrace("invalid handle %p, failed to Get Conn info", thandle);
return -1;
}
struct sockaddr_in addr = pConn->addr; struct sockaddr_in addr = pConn->addr;
pInfo->clientIp = (uint32_t)(addr.sin_addr.s_addr); pInfo->clientIp = (uint32_t)(addr.sin_addr.s_addr);