Commit 1c4ec91a authored by Jelte Jansen's avatar Jelte Jansen Committed by JINMEI Tatuya
Browse files

[2275] valgrind fixes: uninitialized memory

parent b41cca56
......@@ -410,6 +410,7 @@ private:
isc_throw(Unexpected,
"mkstemp() created a filename too long for sun_path");
}
memset(socket_address.sun_path, 0, sizeof(socket_address.sun_path));
strncpy(socket_address.sun_path, path_, len);
#ifdef HAVE_SA_LEN
socket_address.sun_len = len;
......@@ -542,7 +543,6 @@ TEST_F(SocketRequestorTest, testSocketPassing) {
EXPECT_EQ("foo", socket_id.second);
EXPECT_EQ(0, close(socket_id.first));
}
// Create a second socket server, to test that multiple different
// domains sockets would work as well (even though we don't actually
// use that feature)
......
......@@ -142,6 +142,7 @@ send_fd(const int sock, const int fd) {
if (msghdr.msg_control == NULL) {
return (FD_OTHER_ERROR);
}
memset(msghdr.msg_control, 0, msghdr.msg_controllen);
struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msghdr);
cmsg->cmsg_len = cmsg_len(sizeof(int));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment