mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-16 14:38:49 +00:00
i40e: Fix potential out of bound array access
This is a fix for the static code analysis issue where dcbcfg->numapps could be greater than size of array (i.e dcbcfg->app[I40E_DCBX_MAX_APPS]). The fix makes sure that the array is not accessed past the size of of the array (i.e. I40E_DCBX_MAX_APPS). Copyright updated to 2017. Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
15d23b4c36
commit
1e99854715
@ -1,7 +1,7 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* Intel Ethernet Controller XL710 Family Linux Driver
|
* Intel Ethernet Controller XL710 Family Linux Driver
|
||||||
* Copyright(c) 2013 - 2014 Intel Corporation.
|
* Copyright(c) 2013 - 2017 Intel Corporation.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@ -390,6 +390,8 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv,
|
|||||||
|
|
||||||
if (!dcbcfg->numapps)
|
if (!dcbcfg->numapps)
|
||||||
return;
|
return;
|
||||||
|
if (dcbcfg->numapps > I40E_DCBX_MAX_APPS)
|
||||||
|
dcbcfg->numapps = I40E_DCBX_MAX_APPS;
|
||||||
|
|
||||||
for (i = 0; i < dcbcfg->numapps; i++) {
|
for (i = 0; i < dcbcfg->numapps; i++) {
|
||||||
u8 up, selector;
|
u8 up, selector;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user