Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | From a5c59f6a1479947d33dba5191724cc5fc88a614b Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 22 Apr 2017 10:39:57 -0700 |
| 4 | Subject: [PATCH 2/2] cfparse: clear memory equal to size of array |
| 5 | |
| 6 | Fixes compiler error |
| 7 | cfparse.y: In function 'set_isakmp_proposal': |
| 8 | cfparse.y:2567:3: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size] |
| 9 | |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | src/racoon/cfparse.y | 2 +- |
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/src/racoon/cfparse.y b/src/racoon/cfparse.y |
| 16 | index 0d9bd67..5d9c67b 100644 |
| 17 | --- a/src/racoon/cfparse.y |
| 18 | +++ b/src/racoon/cfparse.y |
| 19 | @@ -2564,7 +2564,7 @@ set_isakmp_proposal(rmconf) |
| 20 | plog(LLV_DEBUG2, LOCATION, NULL, |
| 21 | "encklen=%d\n", s->encklen); |
| 22 | |
| 23 | - memset(types, 0, ARRAYLEN(types)); |
| 24 | + memset(types, 0, sizeof(types)); |
| 25 | types[algclass_isakmp_enc] = s->algclass[algclass_isakmp_enc]; |
| 26 | types[algclass_isakmp_hash] = s->algclass[algclass_isakmp_hash]; |
| 27 | types[algclass_isakmp_dh] = s->algclass[algclass_isakmp_dh]; |
| 28 | -- |
| 29 | 2.12.2 |
| 30 | |