mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-08-25 12:50:26 -04:00
master
fix(resmgr): add index bounds check in select_compile_parse Created-by: leeduo Commit-by: liduo Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) Closes #246 ### 原因 select_compile_parse.cpp 中 IsSelectableOther、IsSelectableLocale、IsSelectableMccmnc 三个函数在访问 keyParams[index] 前缺少边界校验,存在越界访问风险。 ### 描述(修改内容) 为 IsSelectableOther、IsSelectableLocale、IsSelectableMccmnc 三个函数添加 index 边界校验,防止越界访问 keyParams。 | 函数 | 修复内容 | |---|---| | IsSelectableOther | 访问 keyParams[index] 前校验,越界返回 false | | IsSelectableLocale | 执行 keyParams[index++] 前校验,越界返回 false | | IsSelectableMccmnc | 执行 keyParams[index++] 前校验,越界返回 false | See merge request: openharmony/developtools_global_resource_tool!294
OpenHarmony resource compile tool
Description
resource tool is used in computer.In OpenHarmony SDK toolchain.Provide to IDE.Support Windows, Linux, MacOS platform.
Directory Structure
/developtools
|----global_resource_tool
| |----include #Header file
| |----src #source code file
| |----test #Test case
| |----build #Depending on the third-party library compilation script
| |----BUILD.gn #Compile script
| |----CMakeLists.txt #CMake file
| |----win32.cmake #Windows cross compilation script
Instructions
Test
In PC, run python test.py ./restool ./out
Help
resource tool usually integrate to IDE, OpenHarmony compile system.
resource tool command e.g:
-v version
-i input resource path
-o output resource path
-r resource ID header file path
-p package name
-f if output path exists,force override it
-m module name, can add more, split by ','(like entry1,entry2,...)
-j config.json path
-e start id mask, e.g 0x01000000, in [0x01000000, 0x06FFFFFF),[0x08000000, 0x41FFFFFF)
entry Directory Structure
| |----resource
| |----config.json or module.json
./restool -i entry1 -i entry2 -j xxx/module.json -p ohos.demo.xxx -o out -r out/ResourceTable.h
Related to the storehouse
global_resource_tool
Description
Languages
C++
99.4%
CMake
0.4%
Python
0.2%