mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
virtfs-proxy: Fix possible overflow
It's detected by coverity. The socket name specified should fit in the sockadd_un.sun_path. If not abort. Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
parent
821c447675
commit
25ee9a7fa3
2 changed files with 5 additions and 0 deletions
|
@ -738,6 +738,7 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid)
|
|||
return -1;
|
||||
}
|
||||
|
||||
g_assert(strlen(path) < sizeof(proxy.sun_path));
|
||||
sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
do_perror("socket");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue