From: Li RongQing Date: Sun, 7 Oct 2018 02:22:42 +0000 (+0800) Subject: xfrm: use correct size to initialise sp->ovec X-Git-Tag: v4.20-rc1~14^2~43^2~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f1193e915748291fb205a908db33bd3debece6e2;p=uclinux-h8%2Flinux.git xfrm: use correct size to initialise sp->ovec 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 Signed-off-by: Steffen Klassert --- diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index be3520e429c9..684c0bc01e2c 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@ -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;