fix coverity

This commit is contained in:
nroskill 2023-04-04 02:41:11 +00:00 committed by ob-robot
parent d897a02f21
commit bd4a1f3d3d

View File

@ -146,7 +146,7 @@ int ObUnixDomainListener::run()
struct epoll_event listen_ev;
int epoll_fd = epoll_create(256);
s.sun_family = AF_UNIX;
strncpy(s.sun_path, addr, sizeof(s.sun_path));
strncpy(s.sun_path, addr, sizeof(s.sun_path) - 1);
unlink(addr);
listen_ev.events = EPOLLIN;
listen_ev.data.fd = listen_fd_;