Skip to content

Commit 4643237

Browse files
committed
修复内核对象名称数组越界问题
1 parent 75f1d8d commit 4643237

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ void rt_object_init(struct rt_object *object,
399399
if(obj_name_len > RT_NAME_MAX - 1)
400400
{
401401
LOG_E("Object name %s exceeds RT_NAME_MAX=%d, consider increasing RT_NAME_MAX.", name, RT_NAME_MAX);
402-
RT_ASSERT(obj_name_len <= RT_NAME_MAX - 1);
402+
obj_name_len = RT_NAME_MAX - 1;
403403
}
404404
rt_memcpy(object->name, name, obj_name_len);
405405
object->name[obj_name_len] = '\0';

0 commit comments

Comments
 (0)