1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-protocol: Check arguments in ctdb_allocate_pkt

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-04-28 18:27:11 +10:00 committed by Martin Schwenke
parent 0eca31baf7
commit 2717427e69

View File

@ -32,6 +32,10 @@ int ctdb_allocate_pkt(TALLOC_CTX *mem_ctx, size_t length,
{
size_t new_length;
if (buf == NULL || buflen == NULL) {
return EINVAL;
}
new_length = (length + CTDB_DS_ALIGNMENT-1) & ~(CTDB_DS_ALIGNMENT-1);
*buflen = new_length;