mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-04 02:22:15 +00:00
iproute2: ss: escape all null bytes in abstract unix domain socket
Abstract unix domain socket may embed null characters, these should be translated to '@' when printed by ss the same way the null prefix is currently being translated. Signed-off-by: Isaac Boukris <iboukris@gmail.com>
This commit is contained in:
parent
8ae2c5382b
commit
878dadc79d
@ -2895,7 +2895,9 @@ static int unix_show_sock(const struct sockaddr_nl *addr, struct nlmsghdr *nlh,
|
||||
memcpy(name, RTA_DATA(tb[UNIX_DIAG_NAME]), len);
|
||||
name[len] = '\0';
|
||||
if (name[0] == '\0')
|
||||
name[0] = '@';
|
||||
for (int i = 0; i < len; i++)
|
||||
if (name[i] == '\0')
|
||||
name[i] = '@';
|
||||
stat.name = &name[0];
|
||||
memcpy(stat.local.data, &stat.name, sizeof(stat.name));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user