summaryrefslogtreecommitdiff
path: root/server/thumb-server-internal.c
diff options
context:
space:
mode:
authorHaejeong Kim <backto.kim@samsung.com>2017-04-13 09:35:15 (GMT)
committerHaejeong Kim <backto.kim@samsung.com>2017-04-13 09:35:15 (GMT)
commit3a8c9ceded482a3df2056bfb98cef172deff16d3 (patch)
treeb279b0826744852c08c471bd0d435c02bbaf2481 /server/thumb-server-internal.c
parentf238209b9c81de1606cc43ea4c4e31465a73aaa3 (diff)
downloadlibmedia-thumbnail-3a8c9ceded482a3df2056bfb98cef172deff16d3.zip
libmedia-thumbnail-3a8c9ceded482a3df2056bfb98cef172deff16d3.tar.gz
libmedia-thumbnail-3a8c9ceded482a3df2056bfb98cef172deff16d3.tar.bz2
Change-Id: I1ad4f3628e6c96a78e2523ab8646adbd8ea48e9c
Diffstat (limited to 'server/thumb-server-internal.c')
-rwxr-xr-xserver/thumb-server-internal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 8e0cff7..b9af459 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -226,7 +226,7 @@ static int __thumb_daemon_all_extract(uid_t uid)
break;
}
- strncpy(path, (const char *)sqlite3_column_text(sqlite_stmt, 0), sizeof(path));
+ SAFE_STRLCPY(path, (const char *)sqlite3_column_text(sqlite_stmt, 0), sizeof(path));
path[sizeof(path) - 1] = '\0';
thumb_dbg_slog("Path : %s", path);
@@ -266,7 +266,7 @@ int _thumb_daemon_process_queue_jobs(gpointer data)
recv_msg.msg_type = THUMB_REQUEST_DB_INSERT;
recv_msg.uid = uid;
- strncpy(recv_msg.org_path, path, sizeof(recv_msg.org_path));
+ SAFE_STRLCPY(recv_msg.org_path, path, sizeof(recv_msg.org_path));
recv_msg.org_path[sizeof(recv_msg.org_path) - 1] = '\0';
err = _thumb_daemon_process_job(&recv_msg, &res_msg);
@@ -355,7 +355,7 @@ gboolean _thumb_server_read_socket(GIOChannel *src,
if (res_msg.msg_type == 0)
res_msg.msg_type = recv_msg.msg_type;
res_msg.request_id = recv_msg.request_id;
- strncpy(res_msg.org_path, recv_msg.org_path, recv_msg.origin_path_size);
+ SAFE_STRLCPY(res_msg.org_path, recv_msg.org_path, sizeof(res_msg.org_path));
res_msg.origin_path_size = recv_msg.origin_path_size;
if (res_msg.msg_type != THUMB_RESPONSE_RAW_DATA) {
res_msg.dest_path_size = strlen(res_msg.dst_path)+1;
@@ -417,7 +417,7 @@ static gboolean __thumb_server_send_msg_to_agent(int msg_type)
sock = sock_info.sock_fd;
serv_addr.sun_family = AF_UNIX;
- strncpy(serv_addr.sun_path, THUMB_COMM_SOCK_PATH, strlen(THUMB_COMM_SOCK_PATH));
+ SAFE_STRLCPY(serv_addr.sun_path, THUMB_COMM_SOCK_PATH, sizeof(serv_addr.sun_path));
/* Connecting to the thumbnail server */