coverity: copy into fixed sized buffer

ulab-next-nosound
Laxmikant Rashinkar 10 years ago
parent 1c423dadf4
commit 0311a82c0a

@ -778,6 +778,8 @@ g_tcp_local_connect(int sck, const char *port)
memset(&s, 0, sizeof(struct sockaddr_un));
s.sun_family = AF_UNIX;
strncpy(s.sun_path, port, sizeof(s.sun_path));
s.sun_path[sizeof(s.sun_path) - 1] = 0;
return connect(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_un));
#endif
}
@ -938,6 +940,8 @@ g_tcp_local_bind(int sck, const char *port)
memset(&s, 0, sizeof(struct sockaddr_un));
s.sun_family = AF_UNIX;
strncpy(s.sun_path, port, sizeof(s.sun_path));
s.sun_path[sizeof(s.sun_path) - 1] = 0;
return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_un));
#endif
}

@ -1801,7 +1801,8 @@ void xfuse_devredir_cb_rename_file(void *vp, tui32 IoStatus)
}
old_xinode->parent_inode = fip->new_inode;
strcpy(old_xinode->name, fip->new_name);
strncpy(old_xinode->name, fip->new_name, 1023);
old_xinode->name[1023] = 0;
if (fip->inode != fip->new_inode)
{

@ -34,7 +34,7 @@ struct xrdp_inode
time_t atime; /* Time of last access. */
time_t mtime; /* Time of last modification. */
time_t ctime; /* Time of last status change. */
char name[256]; /* Dir or filename */
char name[1024]; /* Dir or filename */
tui32 device_id; /* for file system redirection */
char is_synced; /* dir struct has been read from */
/* remote device, done just once */

Loading…
Cancel
Save