summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-05-04 15:09:51 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-05-04 15:09:51 +0200
commit30a45900113f98c177367507711f9c0cbd1010b2 (patch)
treea7a86e0be532c65fabb60aeb401a6ec3a8d8b471
parentbfe5db1ea8018aaa940dc6e991110fac62b85516 (diff)
fix buffer overflow in interface data handling
-rw-r--r--interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/interface.c b/interface.c
index fbed513..78dcd83 100644
--- a/interface.c
+++ b/interface.c
@@ -118,7 +118,7 @@ interface_add_data(struct interface *iface, const struct blob_attr *data)
if (!blobmsg_check_attr(data, true))
return UBUS_STATUS_INVALID_ARGUMENT;
- n = calloc(1, sizeof(*data) + blob_pad_len(data));
+ n = calloc(1, sizeof(*n) + blob_pad_len(data));
memcpy(n->data, data, blob_pad_len(data));
n->node.key = blobmsg_name(data);