summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/ipc_pipe.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libcamera/ipc_pipe.cpp b/src/libcamera/ipc_pipe.cpp
index 84136a82..ad870fd4 100644
--- a/src/libcamera/ipc_pipe.cpp
+++ b/src/libcamera/ipc_pipe.cpp
@@ -106,8 +106,11 @@ IPCUnixSocket::Payload IPCMessage::payload() const
memcpy(payload.data.data(), &header_, sizeof(Header));
- /* \todo Make this work without copy */
- memcpy(payload.data.data() + sizeof(Header), data_.data(), data_.size());
+ if (data_.size() > 0) {
+ /* \todo Make this work without copy */
+ memcpy(payload.data.data() + sizeof(Header),
+ data_.data(), data_.size());
+ }
for (const FileDescriptor &fd : fds_)
payload.fds.push_back(fd.fd());