kni对fd异常判空。

This commit is contained in:
zhengchao
2018-11-26 12:05:18 +08:00
parent 089499bdd5
commit 35c2559f8a
2 changed files with 9 additions and 3 deletions

View File

@@ -251,6 +251,12 @@ void __kni_event_cb(evutil_socket_t fd, short what, void * user)
__cmsghdr = CMSG_FIRSTHDR(&__msghdr);
__fds = (int *) (CMSG_DATA(__cmsghdr));
if (unlikely(__cmsghdr == NULL))
{
TFE_LOG_ERROR(__ctx->logger, "Failed at fetch CMSG_FIRSTHDR() from incoming fds, close KNI connection.");
goto __close_kni_connection;
}
if (unlikely(__fds == NULL))
{
TFE_LOG_ERROR(__ctx->logger, "Failed at fetch CMSG_DATA() from incoming fds, close KNI connection.");