Commit 471dd2ef authored by Vinson Lee's avatar Vinson Lee Committed by Dave Airlie
Browse files

drm: Ensure string is null terminated.



Fixes Coverity buffer not null terminated defect.

Signed-off-by: default avatarVinson Lee <vlee@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent baa91d64
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2118,8 +2118,10 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags,
	property->num_values = num_values;
	INIT_LIST_HEAD(&property->enum_blob_list);

	if (name)
	if (name) {
		strncpy(property->name, name, DRM_PROP_NAME_LEN);
		property->name[DRM_PROP_NAME_LEN-1] = '\0';
	}

	list_add_tail(&property->head, &dev->mode_config.property_list);
	return property;