From 5ae437f95a2e7c8425f1190aa19a41623341a397 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Wed, 7 Sep 2016 14:55:33 +0900 Subject: Fix Svace issue - non-terminated string [Version] 0.2.72 [Profile] Common [Issue Type] Svace [Dependency module] N/A [Dependency commit] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-mobile_20160906.1] Change-Id: Ic313c50b69445d1c56490e0b60fec7029f4b4e73 Signed-off-by: Jeongmo Yang --- packaging/capi-media-camera.spec | 2 +- src/camera.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 84971c5..c69fa5d 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.2.71 +Version: 0.2.72 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index 6fcde32..b71ac92 100644 --- a/src/camera.c +++ b/src/camera.c @@ -1543,7 +1543,7 @@ static void *_camera_msg_handler_func(gpointer data) cam_idle_event->event = cam_msg->event; cam_idle_event->cb_info = cb_info; g_mutex_init(&cam_idle_event->event_mutex); - memcpy(cam_idle_event->recv_msg, cam_msg->recv_msg, sizeof(cam_idle_event->recv_msg)); + strncpy(cam_idle_event->recv_msg, cam_msg->recv_msg, sizeof(cam_idle_event->recv_msg) - 1); /*LOGD("t:%d add camera event[%d, %p] to IDLE", type, event, cam_idle_event);*/ @@ -1685,7 +1685,7 @@ static void __camera_add_msg_to_queue(camera_cb_info_s *cb_info, int api, int ev cam_msg->event = event; cam_msg->event_class = event_class; - memcpy(cam_msg->recv_msg, msg, sizeof(cam_msg->recv_msg)); + strncpy(cam_msg->recv_msg, msg, sizeof(cam_msg->recv_msg) - 1); /*LOGD("add camera message to queue : api %d, event %d, event_class %d", api, event, event_class);*/ -- cgit v1.2.3