mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
rpmsgdev: devpath may exceed RPMSG_NAME_SIZE
Signed-off-by: yintao <yintao@xiaomi.com>
This commit is contained in:
@@ -1160,6 +1160,9 @@ int rpmsgdev_register(FAR const char *remotecpu, FAR const char *remotepath,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEBUGASSERT(strlen(remotepath) + RPMSGDEV_NAME_PREFIX_LEN <=
|
||||||
|
RPMSG_NAME_SIZE);
|
||||||
|
|
||||||
dev = kmm_zalloc(sizeof(*dev));
|
dev = kmm_zalloc(sizeof(*dev));
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
* Pre-processor definitions
|
* Pre-processor definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define RPMSGDEV_NAME_PREFIX "rpmsgdev-"
|
#define RPMSGDEV_NAME_PREFIX "rpdev-"
|
||||||
#define RPMSGDEV_NAME_PREFIX_LEN 9
|
#define RPMSGDEV_NAME_PREFIX_LEN 6
|
||||||
|
|
||||||
#define RPMSGDEV_OPEN 1
|
#define RPMSGDEV_OPEN 1
|
||||||
#define RPMSGDEV_CLOSE 2
|
#define RPMSGDEV_CLOSE 2
|
||||||
|
|||||||
Reference in New Issue
Block a user