diff options
author | Vinson Lee <vlee@vmware.com> | 2011-11-10 11:55:40 -0800 |
---|---|---|
committer | Eugeni Dodonov <eugeni.dodonov@intel.com> | 2012-02-10 18:01:20 -0200 |
commit | 30dc6b0c34c347e2400595973078ce19bf1508b4 (patch) | |
tree | b16619b0f613123a5020ffb63761f5df2a55c7fd | |
parent | 5ee10e0be17bb6a3eca2e597545ffce14186c5bd (diff) |
drm: Ensure string is null terminated.
Fixes Coverity buffer not null terminated defect.
Signed-off-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 1367ced8c26..55b8a9fe387 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2115,8 +2115,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; |