Skip to content

Commit a947dc4

Browse files
authored
Merge pull request #117 from RealAstolfo/array-index-ub-change
moved array sanity check to before the array access
2 parents 1dbdaae + 1ba231f commit a947dc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/displayport/src/dp_configcaps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ struct DPCDHALImpl : DPCDHAL
402402
if (caps.linkRateTable[0] != 0)
403403
{
404404
bIndexedLinkrateCapable = true;
405-
for (int i = 0; caps.linkRateTable[i] && (i < NV_DPCD_SUPPORTED_LINK_RATES__SIZE); i++)
405+
for (int i = 0; (i < NV_DPCD_SUPPORTED_LINK_RATES__SIZE) && caps.linkRateTable[i]; i++)
406406
{
407407
if (linkRate < caps.linkRateTable[i])
408408
linkRate = caps.linkRateTable[i];

0 commit comments

Comments
 (0)