mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-03 15:58:43 +00:00
reds: Replace strncpy with g_strlcpy
strncpy is considered unsafe Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
c52da2fec5
commit
5554b1ec95
1
cfg.mk
1
cfg.mk
@ -42,7 +42,6 @@ local-checks-to-skip = \
|
||||
sc_prohibit_stat_st_blocks \
|
||||
sc_prohibit_magic_number_exit \
|
||||
sc_prohibit_strcmp \
|
||||
sc_prohibit_strncpy \
|
||||
sc_prohibit_undesirable_word_seq \
|
||||
sc_root_tests \
|
||||
sc_space_tab \
|
||||
|
||||
@ -2504,7 +2504,7 @@ static int reds_init_socket(const char *addr, int portnr, int family)
|
||||
}
|
||||
|
||||
local.sun_family = AF_UNIX;
|
||||
strncpy(local.sun_path, addr, sizeof(local.sun_path) -1);
|
||||
g_strlcpy(local.sun_path, addr, sizeof(local.sun_path));
|
||||
unlink(local.sun_path);
|
||||
len = SUN_LEN(&local);
|
||||
if (bind(slisten, (struct sockaddr *)&local, len) == -1) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user