13ceed64fSopenharmony_ci**IssueNo**: 23ceed64fSopenharmony_ci 33ceed64fSopenharmony_ci**Description**: 43ceed64fSopenharmony_ci 53ceed64fSopenharmony_ci**稳定性自检:** 63ceed64fSopenharmony_ci| 自检项 | 自检结果 | 73ceed64fSopenharmony_ci| ------------------------------------------------------------ | -------- | 83ceed64fSopenharmony_ci| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发 | | 93ceed64fSopenharmony_ci| 成员变量进行赋值或创建需要排查并发 | | 103ceed64fSopenharmony_ci| 谨慎在lambda表达式中使用引用捕获 | | 113ceed64fSopenharmony_ci| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串 | | 123ceed64fSopenharmony_ci| map\vector\list\set等stl模板类使用时需要排查并发 | | 133ceed64fSopenharmony_ci| 谨慎考虑加锁范围 | | 143ceed64fSopenharmony_ci| 在IPC通信中谨慎使用同步通信方式 | | 153ceed64fSopenharmony_ci| 禁止传递this指针至其他模块或线程(特别是eventhandler任务) | | 163ceed64fSopenharmony_ci| 禁止将外部传入的裸指针在内部直接构造智能指针 | | 173ceed64fSopenharmony_ci| 禁止多个独立创建的智能指针管理同一地址 | | 183ceed64fSopenharmony_ci| 禁止在析构函数中抛异步任务 | | 193ceed64fSopenharmony_ci| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁 | | 203ceed64fSopenharmony_ci| 禁止在对外接口中未经判空直接使用外部传入的指针 | | 213ceed64fSopenharmony_ci| 禁止接口返回局部变量引用 | | 223ceed64fSopenharmony_ci| 禁止在信号函数中加锁 | | 233ceed64fSopenharmony_ci| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作 | | 243ceed64fSopenharmony_ci| 禁止将同一个cpp编译在不同的so中 | | 253ceed64fSopenharmony_ci 263ceed64fSopenharmony_ci**安全编码自检:** 273ceed64fSopenharmony_ci| 自检项 | 自检结果 | 283ceed64fSopenharmony_ci| -------------------------------------------------------------- | -------- | 293ceed64fSopenharmony_ci| 裸指针避免通过隐式转换构造为sptr | | 303ceed64fSopenharmony_ci| json对象在取值之前必须先判断类型,避免类型不匹配 | | 313ceed64fSopenharmony_ci| 序列化时必须对传入的数组大小进行校验,避免出现超大数组 | | 323ceed64fSopenharmony_ci| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型 | | 333ceed64fSopenharmony_ci| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 | | 343ceed64fSopenharmony_ci| 指针变量、表示资源描述符的变量、bool变量必须赋初值 | | 353ceed64fSopenharmony_ci| readParcelable获取的对象使用前需要判空 | | 363ceed64fSopenharmony_ci| 分配和释放内存的函数需要成对出现 | | 373ceed64fSopenharmony_ci| 申请内存后异常退出前需要及时进行内存释放 | | 383ceed64fSopenharmony_ci| 内存申请前必须对内存大小进行合法性校验 | | 393ceed64fSopenharmony_ci| 内存分配后必须判断是否成功 | | 403ceed64fSopenharmony_ci| 禁止使用realloc、alloca函数 | | 413ceed64fSopenharmony_ci| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰 | | 423ceed64fSopenharmony_ci| 禁止打印内存地址 | | 433ceed64fSopenharmony_ci| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0 | | 443ceed64fSopenharmony_ci| 禁止对有符号整数进行位操作符运算 | | 453ceed64fSopenharmony_ci| 禁止对指针进行逻辑或位运算 | | 463ceed64fSopenharmony_ci| 循环次数如果收外部数据控制,需要检验其合法性 | | 473ceed64fSopenharmony_ci| 禁止使用内存操作类危险函数,需要使用安全函数 | | 483ceed64fSopenharmony_ci| 谨慎使用不可重入函数 | | 493ceed64fSopenharmony_ci| 必须检查安全函数的返回值,并进行正确处理 | | 503ceed64fSopenharmony_ci| 禁止仅通过TokenType类型判断绕过权限校验 | | 513ceed64fSopenharmony_ci 523ceed64fSopenharmony_ci**TDD Result**: 533ceed64fSopenharmony_ci 543ceed64fSopenharmony_ci**XTS Result**: