mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 13:41:55 +00:00
control null terminated string copying
This commit is contained in:
parent
c9c8bd7a7a
commit
937747fd4d
2 changed files with 3 additions and 2 deletions
|
@ -1054,7 +1054,7 @@ static int wpas__bind_server_socket(int fd, const char *ctrl_path, char *name)
|
|||
}
|
||||
}
|
||||
|
||||
strncpy(name, src.sun_path, UNIX_PATH_MAX - 1);
|
||||
strncpy(name, src.sun_path, UNIX_PATH_MAX);
|
||||
name[UNIX_PATH_MAX - 1] = 0;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -61,7 +61,8 @@ int peer_new(struct link *l,
|
|||
r = log_ENOMEM();
|
||||
goto error;
|
||||
}
|
||||
strncpy(p->p2p_mac, mac, MAC_STRLEN - 1);
|
||||
strncpy(p->p2p_mac, mac, MAC_STRLEN);
|
||||
p->p2p_mac[MAC_STRLEN - 1] = 0;
|
||||
|
||||
r = shl_htable_insert_str(&l->peers, &p->p2p_mac, NULL);
|
||||
if (r < 0) {
|
||||
|
|
Loading…
Reference in a new issue