rpmsgdev: devpath may exceed RPMSG_NAME_SIZE

Signed-off-by: yintao <yintao@xiaomi.com>
This commit is contained in:
yintao 2024-03-08 17:29:39 +08:00 committed by Xiang Xiao
parent 190fdd18e2
commit f45eaa608d
2 changed files with 5 additions and 2 deletions

View File

@ -1160,6 +1160,9 @@ int rpmsgdev_register(FAR const char *remotecpu, FAR const char *remotepath,
return -EINVAL;
}
DEBUGASSERT(strlen(remotepath) + RPMSGDEV_NAME_PREFIX_LEN <=
RPMSG_NAME_SIZE);
dev = kmm_zalloc(sizeof(*dev));
if (dev == NULL)
{

View File

@ -33,8 +33,8 @@
* Pre-processor definitions
****************************************************************************/
#define RPMSGDEV_NAME_PREFIX "rpmsgdev-"
#define RPMSGDEV_NAME_PREFIX_LEN 9
#define RPMSGDEV_NAME_PREFIX "rpdev-"
#define RPMSGDEV_NAME_PREFIX_LEN 6
#define RPMSGDEV_OPEN 1
#define RPMSGDEV_CLOSE 2