mirror of
https://gitee.com/openharmony/developtools_profiler
synced 2024-11-23 15:00:17 +00:00
fix security code check
Signed-off-by: lutao <lutao31@huawei.com>
This commit is contained in:
parent
fa4d85b81e
commit
aa5bb840aa
@ -107,14 +107,14 @@ static int QueryParams(const char *queryName)
|
||||
#ifdef HIDEBUG_IN_INIT
|
||||
uint32_t size = PARAM_BUF_LEN;
|
||||
int retLen = SystemGetParameter(queryName, paramOutBuf, &size);
|
||||
if (retLen != 0 || size <= 0) {
|
||||
if (retLen != 0 || size <= 0 || size > PARAM_BUF_LEN - 1) {
|
||||
return 0;
|
||||
}
|
||||
retLen = (int)size;
|
||||
#else
|
||||
char defStrValue[PARAM_BUF_LEN] = { 0 };
|
||||
int retLen = GetParameter(queryName, defStrValue, paramOutBuf, PARAM_BUF_LEN);
|
||||
if (retLen == 0) {
|
||||
if (retLen == 0 || retLen > PARAM_BUF_LEN - 1) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user