net/igb: fix memcpy length
authorYong Wang <wang.yong19@zte.com.cn>
Tue, 12 Sep 2017 12:44:00 +0000 (08:44 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:48 +0000 (02:49 +0200)
commit671f8776871d2e46c0619c743a82b2f6f6ce58ec
treead14d8e0c284794eb4c3fbc0d6635f9b11855454
parent005ce1ca39da87902bd49976e1945b70101c1167
net/igb: fix memcpy length

The size of "flex_filter.filter_info.mask" and "filter->mask" are 16
bytes, but the length of memcpy--"RTE_ALIGN(filter->len, sizeof(char))
/ sizeof(char)" may reach 128 bytes which may cause array access out
of bound.

Fix it by replacing "sizeof(char)" by "CHAR_BIT".

Fixes: 231d43909a31 ("igb: migrate flex filter to new API")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/e1000/igb_ethdev.c