Browse Source

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 <lirongqing@baidu.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Li RongQing 6 years ago
parent
commit
f1193e9157
1 changed files with 1 additions and 1 deletions
  1. 1 1
      net/xfrm/xfrm_input.c

+ 1 - 1
net/xfrm/xfrm_input.c

@@ -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;