summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/socket.cpp4
-rw-r--r--src/dpl/core/src/assert.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/common/socket.cpp b/src/common/socket.cpp
index a30d605..4ab49bf 100644
--- a/src/common/socket.cpp
+++ b/src/common/socket.cpp
@@ -122,9 +122,9 @@ Socket Socket::connect(const std::string &path)
std::error_code(errno, std::generic_category()),
"socket create failed!");
- sockaddr_un addr;
+ sockaddr_un addr = {};
addr.sun_family = AF_UNIX;
- strncpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path));
+ strncpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path) - 1);
if (::connect(fd, reinterpret_cast<sockaddr *>(&addr),
sizeof(sockaddr_un)) == -1)
diff --git a/src/dpl/core/src/assert.cpp b/src/dpl/core/src/assert.cpp
index acaa958..489beaa 100644
--- a/src/dpl/core/src/assert.cpp
+++ b/src/dpl/core/src/assert.cpp
@@ -56,7 +56,7 @@ void AssertProc(const char *condition,
INTERNAL_LOG("### Function: " << function);
INTERNAL_LOG(
"################################################################################");
- } catch (Exception) {
+ } catch (Exception&) {
// Just ignore possible double errors
}