From bd4a1f3d3d4d50d302fa8d37f11487b8daca63da Mon Sep 17 00:00:00 2001 From: nroskill Date: Tue, 4 Apr 2023 02:41:11 +0000 Subject: [PATCH] fix coverity --- src/diagnose/lua/ob_lua_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnose/lua/ob_lua_handler.cpp b/src/diagnose/lua/ob_lua_handler.cpp index 4180aa0b8..59bd8f3e9 100644 --- a/src/diagnose/lua/ob_lua_handler.cpp +++ b/src/diagnose/lua/ob_lua_handler.cpp @@ -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_;