修复memcpy_s传入缓冲区的大小可能是非剩余空间的问题 Created-by: LiuFeng_Again Commit-by: LiuFeng_Again Merged-by: openharmony_ci Description: ### 相关的Issue https://gitcode.com/openharmony/drivers_peripheral/issues/7442 ### 原因(目的、解决的问题等) ### 描述(做了什么,变更了什么) ### 测试用例(新增、改动、可能影响的功能)   See merge request: openharmony/drivers_peripheral!9335
USB
Introduction
This repository contains the API definitions of the USB host Driver Development Kit (DDK) and USB device DDK and their implementation.
- USB host DDK: provides APIs to read and write USB device data of third-party function drivers in user mode, register device insertion/removal time notifications with the kernel USB driver framework, and remove USB logical devices.
Figure 1 Logical view of the modules on the USB host

- USB device DDK: creates and deletes USB devices, obtains notification events, enables or disables event listening, implements non-isochronous and isochronous data transfer over USB pipes, and sets custom USB attributes.
Figure 2 Logical view of the modules on the USB device

Directory Structure
The source code directory structure is as follows:
/drivers/peripheral/usb
├── ddk # DDK of the USB modules
│ └── device # DDK implementation for the USB device
│ └── host # DDK implementation for the USB host
├── gadget # Driver demo implementation for the USB device
│ └── function # Driver demo for the USB device, including the abstract communication model (ACM) driver and Ethernet control model (ECM) driver
├── interfaces # Driver capability APIs in user mode
│ └── ddk # API definitions for both the USB device and host
├── net # ECM driver demo implementation for the USB host
├── sample # Application test program implementation
│ └── device # Implementation of the ACM driver read/write and speed test application for the USB device (for Linux and LiteOS)
│ └── host # Implementation of the ACM driver read/write and speed test application for the USB host (for Linux and LiteOS)
├── serial # ACM driver demo implementation for the USB host
├── test # Test code
│ └── unittest # Unit test code for both the USB host and device
Available APIs
The USB host DDK provides driver capability APIs that can be directly called in user mode. The APIs can be classified into the DDK initialization class, interface operation class, and request operation class by function. These APIs can be used to perform DDK initialization, bind/release and open/close an interface, allocate/release a request, and implement isochronous or non-isochronous transfer.
Table 1 describes some of the USB host DDK APIs.
Table 1 USB host DDK APIs
The USB device DDK provides device management, I/O management, and configuration management APIs, which can be used to create and delete a device, obtain/open an interface, and perform isochronous or non-isochronous transfer.
Table 2 describes some of the USB device DDK APIs.
Table 2 USB device DDK APIs
How to Use
The core functions of this repository are as follows:
- USB host: provides DDK APIs and raw APIs, which are used to read and write USB device data of third-party function drivers in user mode.
- USB device: provides APIs to customize USB devices, such as serial ports, network adapters, keyboards, and custom devices.