提交 6e19dc5a 编写于 作者: L Li RongQing 提交者: Xie XiuQi

xfrm: use correct size to initialise sp->ovec

[ Upstream commit f1193e91 ]

This place should want to initialize array, not a element,
so it should be sizeof(array) instead of sizeof(element)

but now this array only has one element, so no error in
this condition that XFRM_MAX_OFFLOAD_DEPTH is 1
Signed-off-by: NLi RongQing <lirongqing@baidu.com>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2599b54d
...@@ -131,7 +131,7 @@ struct sec_path *secpath_dup(struct sec_path *src) ...@@ -131,7 +131,7 @@ struct sec_path *secpath_dup(struct sec_path *src)
sp->len = 0; sp->len = 0;
sp->olen = 0; sp->olen = 0;
memset(sp->ovec, 0, sizeof(sp->ovec[XFRM_MAX_OFFLOAD_DEPTH])); memset(sp->ovec, 0, sizeof(sp->ovec));
if (src) { if (src) {
int i; int i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册