15ba71b47Sopenharmony_ci**IssueNo**:
25ba71b47Sopenharmony_ci
35ba71b47Sopenharmony_ci**Description**:
45ba71b47Sopenharmony_ci
55ba71b47Sopenharmony_ci**稳定性自检:**
65ba71b47Sopenharmony_ci| 自检项                                                       | 自检结果  |
75ba71b47Sopenharmony_ci| ------------------------------------------------------------ | -------- |
85ba71b47Sopenharmony_ci| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
95ba71b47Sopenharmony_ci| 成员变量进行赋值或创建需要排查并发                               |          |
105ba71b47Sopenharmony_ci| 谨慎在lambda表达式中使用引用捕获                                |          |
115ba71b47Sopenharmony_ci| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
125ba71b47Sopenharmony_ci| map\vector\list\set等stl模板类使用时需要排查并发                |          |
135ba71b47Sopenharmony_ci| 谨慎考虑加锁范围                                               |          |
145ba71b47Sopenharmony_ci| 在IPC通信中谨慎使用同步通信方式                                 |          |
155ba71b47Sopenharmony_ci| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
165ba71b47Sopenharmony_ci| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
175ba71b47Sopenharmony_ci| 禁止多个独立创建的智能指针管理同一地址                           |          |
185ba71b47Sopenharmony_ci| 禁止在析构函数中抛异步任务                                      |          |
195ba71b47Sopenharmony_ci| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
205ba71b47Sopenharmony_ci| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
215ba71b47Sopenharmony_ci| 禁止接口返回局部变量引用                                        |          |
225ba71b47Sopenharmony_ci| 禁止在信号函数中加锁                                            |          |
235ba71b47Sopenharmony_ci| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
245ba71b47Sopenharmony_ci| 禁止将同一个cpp编译在不同的so中                                 |          |
255ba71b47Sopenharmony_ci
265ba71b47Sopenharmony_ci**安全编码自检:**
275ba71b47Sopenharmony_ci| 自检项                                                          | 自检结果 |
285ba71b47Sopenharmony_ci| -------------------------------------------------------------- | -------- |
295ba71b47Sopenharmony_ci| 裸指针避免通过隐式转换构造为sptr                                 |          |
305ba71b47Sopenharmony_ci| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
315ba71b47Sopenharmony_ci| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
325ba71b47Sopenharmony_ci| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
335ba71b47Sopenharmony_ci| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
345ba71b47Sopenharmony_ci| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
355ba71b47Sopenharmony_ci| readParcelable获取的对象使用前需要判空                            |          |
365ba71b47Sopenharmony_ci| 分配和释放内存的函数需要成对出现                                   |          |
375ba71b47Sopenharmony_ci| 申请内存后异常退出前需要及时进行内存释放                            |          |
385ba71b47Sopenharmony_ci| 内存申请前必须对内存大小进行合法性校验                              |          |
395ba71b47Sopenharmony_ci| 内存分配后必须判断是否成功                                         |          |
405ba71b47Sopenharmony_ci| 禁止使用realloc、alloca函数                                       |          |
415ba71b47Sopenharmony_ci| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
425ba71b47Sopenharmony_ci| 禁止打印内存地址                                                  |          |
435ba71b47Sopenharmony_ci| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
445ba71b47Sopenharmony_ci| 禁止对有符号整数进行位操作符运算                                    |          |
455ba71b47Sopenharmony_ci| 禁止对指针进行逻辑或位运算                                         |          |
465ba71b47Sopenharmony_ci| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
475ba71b47Sopenharmony_ci| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
485ba71b47Sopenharmony_ci| 谨慎使用不可重入函数                                               |          |
495ba71b47Sopenharmony_ci| 必须检查安全函数的返回值,并进行正确处理                             |          |
505ba71b47Sopenharmony_ci| 禁止仅通过TokenType类型判断绕过权限校验                             |          |
515ba71b47Sopenharmony_ci
525ba71b47Sopenharmony_ci**TDD Result**:
535ba71b47Sopenharmony_ci
545ba71b47Sopenharmony_ci**XTS Result**: