summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulian Bouzas <julian.bouzas@collabora.com>2021-06-26 11:04:51 -0400
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-07-28 13:19:02 +0300
commit17a8b7ea6fc6a0470f83012810f12048f6ae9894 (patch)
treeb2000b01fca7a18c1d85bc31b83555937acc87dd /lib
parente63a86694b05178741d8e6bf3c54eed4b543388d (diff)
wpipc: protocol: make sure buffer is initialized to 0 before building reply/request
Fixes valgrind errors Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/protocol.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/protocol.c b/lib/protocol.c
index 6de4bf5..6b2bcf1 100644
--- a/lib/protocol.c
+++ b/lib/protocol.c
@@ -60,6 +60,8 @@ icipc_protocol_build_request (uint8_t *buffer,
struct spa_pod_builder b;
struct spa_pod_frame f;
+ memset (buffer, 0, size);
+
if (args == NULL)
args = &none;
@@ -126,6 +128,8 @@ icipc_protocol_build_reply_ok (uint8_t *buffer,
struct spa_pod_builder b;
struct spa_pod_frame f;
+ memset (buffer, 0, size);
+
if (value == NULL)
value = &none;
@@ -143,6 +147,9 @@ icipc_protocol_build_reply_error (uint8_t *buffer,
{
struct spa_pod_builder b;
struct spa_pod_frame f;
+
+ memset (buffer, 0, size);
+
spa_pod_builder_init (&b, buffer, size);
spa_pod_builder_push_struct (&b, &f);
spa_pod_builder_int (&b, REPLY_CODE_ERROR);