1eace7efcSopenharmony_ci**IssueNo**:
2eace7efcSopenharmony_ci
3eace7efcSopenharmony_ci**Description**:
4eace7efcSopenharmony_ci
5eace7efcSopenharmony_ci**稳定性自检:**
6eace7efcSopenharmony_ci| 自检项                                                       | 自检结果  |
7eace7efcSopenharmony_ci| ------------------------------------------------------------ | -------- |
8eace7efcSopenharmony_ci| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
9eace7efcSopenharmony_ci| 成员变量进行赋值或创建需要排查并发                               |          |
10eace7efcSopenharmony_ci| 谨慎在lambda表达式中使用引用捕获                                |          |
11eace7efcSopenharmony_ci| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
12eace7efcSopenharmony_ci| map\vector\list\set等stl模板类使用时需要排查并发                |          |
13eace7efcSopenharmony_ci| 谨慎考虑加锁范围                                               |          |
14eace7efcSopenharmony_ci| 在IPC通信中谨慎使用同步通信方式                                 |          |
15eace7efcSopenharmony_ci| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
16eace7efcSopenharmony_ci| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
17eace7efcSopenharmony_ci| 禁止多个独立创建的智能指针管理同一地址                           |          |
18eace7efcSopenharmony_ci| 禁止在析构函数中抛异步任务                                      |          |
19eace7efcSopenharmony_ci| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
20eace7efcSopenharmony_ci| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
21eace7efcSopenharmony_ci| 禁止接口返回局部变量引用                                        |          |
22eace7efcSopenharmony_ci| 禁止在信号函数中加锁                                            |          |
23eace7efcSopenharmony_ci| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
24eace7efcSopenharmony_ci| 禁止将同一个cpp编译在不同的so中                                 |          |
25eace7efcSopenharmony_ci
26eace7efcSopenharmony_ci**安全编码自检:**
27eace7efcSopenharmony_ci| 自检项                                                          | 自检结果 |
28eace7efcSopenharmony_ci| -------------------------------------------------------------- | -------- |
29eace7efcSopenharmony_ci| 裸指针避免通过隐式转换构造为sptr                                 |          |
30eace7efcSopenharmony_ci| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
31eace7efcSopenharmony_ci| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
32eace7efcSopenharmony_ci| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
33eace7efcSopenharmony_ci| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
34eace7efcSopenharmony_ci| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
35eace7efcSopenharmony_ci| readParcelable获取的对象使用前需要判空                            |          |
36eace7efcSopenharmony_ci| 分配和释放内存的函数需要成对出现                                   |          |
37eace7efcSopenharmony_ci| 申请内存后异常退出前需要及时进行内存释放                            |          |
38eace7efcSopenharmony_ci| 内存申请前必须对内存大小进行合法性校验                              |          |
39eace7efcSopenharmony_ci| 内存分配后必须判断是否成功                                         |          |
40eace7efcSopenharmony_ci| 禁止使用realloc、alloca函数                                       |          |
41eace7efcSopenharmony_ci| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
42eace7efcSopenharmony_ci| 禁止打印内存地址                                                  |          |
43eace7efcSopenharmony_ci| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
44eace7efcSopenharmony_ci| 禁止对有符号整数进行位操作符运算                                    |          |
45eace7efcSopenharmony_ci| 禁止对指针进行逻辑或位运算                                         |          |
46eace7efcSopenharmony_ci| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
47eace7efcSopenharmony_ci| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
48eace7efcSopenharmony_ci| 谨慎使用不可重入函数                                               |          |
49eace7efcSopenharmony_ci| 必须检查安全函数的返回值,并进行正确处理                             |          |
50eace7efcSopenharmony_ci| 禁止仅通过TokenType类型判断绕过权限校验                             |          |
51eace7efcSopenharmony_ci
52eace7efcSopenharmony_ci**TDD Result**:
53eace7efcSopenharmony_ci
54eace7efcSopenharmony_ci**XTS Result**: