未验证 提交 d04a0230 编写于 作者: O openharmony_ci 提交者: Gitee

!1117 修复代码静态检查(0823)

Merge pull request !1117 from cheng_jinsong/codex
......@@ -262,7 +262,7 @@ static int hookExecutionProc(ListNode *node, void *cookie)
*/
int HookMgrExecute(HOOK_MGR *hookMgr, int stage, void *executionContext, const HOOK_EXEC_OPTIONS *options)
{
int flags;
unsigned int flags;
HOOK_STAGE *stageItem;
HOOK_EXECUTION_ARGS args;
......@@ -276,7 +276,7 @@ int HookMgrExecute(HOOK_MGR *hookMgr, int stage, void *executionContext, const H
flags = 0;
if (options != NULL) {
flags = options->flags;
flags = (unsigned int)(options->flags);
}
args.executionContext = executionContext;
......
......@@ -27,6 +27,7 @@ extern "C" {
#define PARAM_NAME_LEN_MAX 96
#define OS_FULL_NAME_LEN 128
#define VERSION_ID_MAX_LEN 256
#define PARAM_BUFFER_MAX (0x01 << 16)
static const char EMPTY_STR[] = { "" };
......
......@@ -42,7 +42,7 @@ INIT_LOCAL_API int IsValidParamValue(const char *value, uint32_t len)
INIT_LOCAL_API int GetParameter_(const char *key, const char *def, char *value, uint32_t len)
{
if ((key == NULL) || (value == NULL)) {
if ((key == NULL) || (value == NULL) || (len > (uint32_t)PARAM_BUFFER_MAX)) {
return EC_INVALID;
}
uint32_t size = len;
......
......@@ -169,7 +169,7 @@ ListNode *OH_ListFind(const ListNode *head, void *data, ListTraversalProc compar
* @return return -1 for invalid input arguments.
* when TRAVERSE_STOP_WHEN_ERROR is specified, it will return errors from traversalProc
*/
int OH_ListTraversal(ListNode *head, void *data, ListTraversalProc traversalProc, int flags);
int OH_ListTraversal(ListNode *head, void *data, ListTraversalProc traversalProc, unsigned int flags);
/**
* @brief ListNode destroy function prototype
......
......@@ -151,7 +151,7 @@ ListNode *OH_ListFind(const ListNode *head, void *data, ListTraversalProc compar
* @return return -1 for invalid input arguments.
* when TRAVERSE_STOP_WHEN_ERROR is specified, it will return errors from traversalProc
*/
int OH_ListTraversal(ListNode *head, void *data, ListTraversalProc traversalProc, int flags)
int OH_ListTraversal(ListNode *head, void *data, ListTraversalProc traversalProc, unsigned int flags)
{
int ret;
ListNode *match;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册