summaryrefslogtreecommitdiff
path: root/ctdb/protocol/protocol_event.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2017-08-07 17:55:50 +1000
committerMartin Schwenke <martins@samba.org>2017-08-30 14:59:26 +0200
commitb107397d8bbb767127807ee86ce88d0e14a53f09 (patch)
tree1cb588233b01ff85c80b4867ea8d9a261be538a2 /ctdb/protocol/protocol_event.c
parent54421df6cdc3318187a298a709ea38d07e2e716d (diff)
downloadsamba-b107397d8bbb767127807ee86ce88d0e14a53f09.tar.gz
ctdb-protocol: Fix marshalling for ctdb_event_request
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/protocol/protocol_event.c')
-rw-r--r--ctdb/protocol/protocol_event.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ctdb/protocol/protocol_event.c b/ctdb/protocol/protocol_event.c
index 3a1a6eb4d91..83aa24e731f 100644
--- a/ctdb/protocol/protocol_event.c
+++ b/ctdb/protocol/protocol_event.c
@@ -873,6 +873,11 @@ int ctdb_event_request_push(struct ctdb_event_request *in,
offset += np;
ctdb_event_request_data_push(&in->rdata, buf+offset, &np);
+ offset += np;
+
+ if (offset > *buflen) {
+ return EMSGSIZE;
+ }
return 0;
}
@@ -895,6 +900,11 @@ int ctdb_event_request_pull(uint8_t *buf, size_t buflen,
if (ret != 0) {
return ret;
}
+ offset += np;
+
+ if (offset > buflen) {
+ return EMSGSIZE;
+ }
return 0;
}