mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-30 22:01:06 +00:00
解决SystemGetParameterCommitId接口fuzzy测试会引起sigbus问题
Signed-off-by: laiguizhong <laiguizhong@huawei.com> Change-Id: I81dbe3f13087e280c60a1e6c8b4e825e0c09de3d
This commit is contained in:
parent
7fb8488f21
commit
d0d2e56dad
@ -72,7 +72,10 @@ INIT_LOCAL_API ParamTrieNode *GetTrieNodeByHandle(ParamHandle handle)
|
||||
WorkSpace *workSpace = HASHMAP_ENTRY(node, WorkSpace, hashNode);
|
||||
WORKSPACE_RW_UNLOCK(*paramSpace);
|
||||
index = index - workSpace->area->startIndex;
|
||||
return (ParamTrieNode *)GetTrieNode(workSpace, index);
|
||||
if (PARAM_IS_ALIGNED(index)) {
|
||||
return (ParamTrieNode *)GetTrieNode(workSpace, index);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INIT_LOCAL_API WorkSpace *GetFirstWorkSpace(void)
|
||||
|
@ -49,6 +49,7 @@ typedef struct cmdLineInfo {
|
||||
#define UNUSED(x) (void)(x)
|
||||
#endif
|
||||
#define PARAM_ALIGN(len) (((len) + 0x03) & (~0x03))
|
||||
#define PARAM_IS_ALIGNED(x) (((x) & 0x03) == 0)
|
||||
#define PARAM_ENTRY(ptr, type, member) (type *)((char *)(ptr)-offsetof(type, member))
|
||||
|
||||
#define IS_READY_ONLY(name) \
|
||||
|
Loading…
Reference in New Issue
Block a user