diff options
Diffstat (limited to 'ctdb/protocol')
-rw-r--r-- | ctdb/protocol/protocol_event.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ctdb/protocol/protocol_event.c b/ctdb/protocol/protocol_event.c index 83aa24e731f..b1a7498be08 100644 --- a/ctdb/protocol/protocol_event.c +++ b/ctdb/protocol/protocol_event.c @@ -932,6 +932,11 @@ int ctdb_event_reply_push(struct ctdb_event_reply *in, offset += np; ctdb_event_reply_data_push(&in->rdata, buf+offset, &np); + offset += np; + + if (offset > *buflen) { + return EMSGSIZE; + } return 0; } @@ -954,6 +959,11 @@ int ctdb_event_reply_pull(uint8_t *buf, size_t buflen, if (ret != 0) { return ret; } + offset += np; + + if (offset > buflen) { + return EMSGSIZE; + } return 0; } |