aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2020-08-31 15:34:09 +0300
committerDmitry Vyukov <dvyukov@google.com>2020-09-22 10:12:23 +0200
commitaff59df2575f773855b00b001ebd71cb7e55942e (patch)
tree2777456649b8f218b48de830ee985411182b49e8 /executor
parentf7907acd76a744261067bc4613efd389ce7648ed (diff)
executor/common_linux.h: extend netlink helpers to support zero-payload attributes (flags)
This is required for 802.11 pseudo syscalls (that will be added later).
Diffstat (limited to 'executor')
-rw-r--r--executor/common_linux.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 04a8c35b5..e472e7644 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -150,7 +150,8 @@ static void netlink_attr(struct nlmsg* nlmsg, int typ,
struct nlattr* attr = (struct nlattr*)nlmsg->pos;
attr->nla_len = sizeof(*attr) + size;
attr->nla_type = typ;
- memcpy(attr + 1, data, size);
+ if (size > 0)
+ memcpy(attr + 1, data, size);
nlmsg->pos += NLMSG_ALIGN(attr->nla_len);
}