prevent copying error over TDM_NAME_LEN(64) length string
[platform/core/uifw/libtdm.git] / client / tdm_client.c
index d60c6c9..fd51b29 100644 (file)
@@ -2082,7 +2082,8 @@ tdm_client_create_voutput(tdm_client *client, const char *name, tdm_error *error
        LIST_INITHEAD(&private_voutput->buffer_list);
 
        private_voutput->private_client = private_client;
-       strncpy(private_voutput->name, name, TDM_NAME_LEN);
+       strncpy(private_voutput->name, name, TDM_NAME_LEN - 1);
+       private_voutput->name[TDM_NAME_LEN - 1] = '\0';
 
        private_voutput->wl_voutput = wl_tdm_create_voutput((struct wl_tdm *)wrapper, name);
        wl_proxy_wrapper_destroy(wrapper);