Fix array bound failure in api_sr_localsid_add_del 70/14570/2
authorLijian Zhang <Lijian.Zhang@arm.com>
Tue, 28 Aug 2018 02:18:24 +0000 (10:18 +0800)
committerDamjan Marion <dmarion@me.com>
Thu, 30 Aug 2018 10:18:38 +0000 (10:18 +0000)
commitec2a9bbb89a4ec1ebf8982f1d611179cd84315b8
tree7cc688d17dd392d679655522581159fb53a01836
parentbe460e72d5d87e4272f4663d9c3edcdc147e70b6
Fix array bound failure in api_sr_localsid_add_del

When compiling VPP with GCC-8.2.0, it gives below error messages.

src/vat/api_format.c: In function ‘api_sr_localsid_add_del’:
src/vat/api_format.c:10839:7: error: ‘memcpy’ forming offset [5, 16] is out of the bounds [0, 4] of object ‘nh_addr4’ with type ‘ip4_address_t’ {aka ‘union <anonymous>’} [-Werror=array-bounds]
       clib_memcpy (mp->nh_addr6, &nh_addr4, sizeof (mp->nh_addr6));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/vat/api_format.c:10809:17: note: ‘nh_addr4’ declared here
   ip4_address_t nh_addr4;
                 ^~~~~~~~

Change-Id: I9065a3407d53c1f91974b32381972c4edb45144c
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
src/vat/api_format.c