提交 7f48ebf9 编写于 作者: X xiacong

<fix>

修复cppcheck告警
Signed-off-by: Nxiacong <xiacong4@huawei.com>
Change-Id: Ifd15ff9711cdb6f37ca65725e1c6c50869077246
上级 6c61f22f
......@@ -86,7 +86,7 @@ static bool InstallSeccompPolicy(const struct sock_filter* filter, size_t filter
static char *GetFilterFileByName(const char *filterName)
{
size_t maxFilterNameLen = PATH_MAX - strlen(FILTER_LIB_PATH_FORMAT) + strlen("%s") - 1;
if (filterName == NULL && strlen(filterName) > maxFilterNameLen) {
if (filterName == NULL || strlen(filterName) > maxFilterNameLen) {
return NULL;
}
......@@ -158,7 +158,7 @@ bool SetSeccompPolicyWithName(const char *filterName)
{
void *handler = NULL;
char *filterLibRealPath = NULL;
struct sock_fprog prog = {0};
struct sock_fprog prog;
bool ret = false;
filterLibRealPath = GetFilterFileByName(filterName);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册