coverity: copy into fixed sized buffer

ulab-next-nosound
Laxmikant Rashinkar 10 years ago
parent 119fd3031c
commit 1c423dadf4

@ -777,7 +777,7 @@ g_tcp_local_connect(int sck, const char *port)
memset(&s, 0, sizeof(struct sockaddr_un));
s.sun_family = AF_UNIX;
strcpy(s.sun_path, port);
strncpy(s.sun_path, port, sizeof(s.sun_path));
return connect(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_un));
#endif
}
@ -937,7 +937,7 @@ g_tcp_local_bind(int sck, const char *port)
memset(&s, 0, sizeof(struct sockaddr_un));
s.sun_family = AF_UNIX;
strcpy(s.sun_path, port);
strncpy(s.sun_path, port, sizeof(s.sun_path));
return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_un));
#endif
}

@ -2184,7 +2184,7 @@ static void xfuse_remove_dir_or_file(fuse_req_t req, fuse_ino_t parent,
}
strcat(full_path, "/");
strcat(full_path, name);
strncat(full_path, name, sizeof(full_path) - strlen(full_path));
if (xinode->is_loc_resource)
{

@ -1026,7 +1026,7 @@ dev_redir_get_dir_listing(void *fusep, tui32 device_id, char *path)
irp->completion_type = CID_CREATE_DIR_REQ;
irp->DeviceId = device_id;
strcpy(irp->pathname, path);
strncpy(irp->pathname, path, 255);
devredir_fuse_data_enqueue(irp, fusep);
DesiredAccess = DA_FILE_READ_DATA | DA_SYNCHRONIZE;
@ -1069,7 +1069,7 @@ dev_redir_file_open(void *fusep, tui32 device_id, char *path,
if (type & OP_RENAME_FILE)
{
irp->completion_type = CID_RENAME_FILE;
strcpy(irp->gen_buf, gen_buf);
strncpy(irp->gen_buf, gen_buf, 1023);
}
else
{
@ -1079,7 +1079,7 @@ dev_redir_file_open(void *fusep, tui32 device_id, char *path,
irp->CompletionId = g_completion_id++;
irp->DeviceId = device_id;
strcpy(irp->pathname, path);
strncpy(irp->pathname, path, 255);
devredir_fuse_data_enqueue(irp, fusep);
if (mode & O_CREAT)
@ -1185,7 +1185,7 @@ devredir_rmdir_or_file(void *fusep, tui32 device_id, char *path, int mode)
irp->completion_type = CID_RMDIR_OR_FILE;
irp->DeviceId = device_id;
strcpy(irp->pathname, path);
strncpy(irp->pathname, path, 255);
devredir_fuse_data_enqueue(irp, fusep);
//DesiredAccess = DA_DELETE | DA_FILE_READ_ATTRIBUTES | DA_SYNCHRONIZE;

Loading…
Cancel
Save