summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-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 */