Merge pull request #117 from RealAstolfo/array-index-ub-change
moved array sanity check to before the array access
This commit is contained in:
commit
a947dc4ad5
@ -402,7 +402,7 @@ struct DPCDHALImpl : DPCDHAL
|
||||
if (caps.linkRateTable[0] != 0)
|
||||
{
|
||||
bIndexedLinkrateCapable = true;
|
||||
for (int i = 0; caps.linkRateTable[i] && (i < NV_DPCD_SUPPORTED_LINK_RATES__SIZE); i++)
|
||||
for (int i = 0; (i < NV_DPCD_SUPPORTED_LINK_RATES__SIZE) && caps.linkRateTable[i]; i++)
|
||||
{
|
||||
if (linkRate < caps.linkRateTable[i])
|
||||
linkRate = caps.linkRateTable[i];
|
||||
|
Loading…
Reference in New Issue
Block a user