]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfrm: use correct size to initialise sp->ovec
authorLi RongQing <lirongqing@baidu.com>
Sun, 7 Oct 2018 02:22:42 +0000 (10:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:31 +0000 (08:20 +0100)
[ Upstream commit f1193e915748291fb205a908db33bd3debece6e2 ]

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: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xfrm/xfrm_input.c

index 790b514f86b62992add8f2e27b6b3e35be2c20c6..d5635908587f4de80396831f24cdf7591522f511 100644 (file)
@@ -131,7 +131,7 @@ struct sec_path *secpath_dup(struct sec_path *src)
        sp->len = 0;
        sp->olen = 0;
 
-       memset(sp->ovec, 0, sizeof(sp->ovec[XFRM_MAX_OFFLOAD_DEPTH]));
+       memset(sp->ovec, 0, sizeof(sp->ovec));
 
        if (src) {
                int i;