Skip to content

Commit b37d86b

Browse files
committed
Fix nodes and links bounds check.
1 parent 13086d3 commit b37d86b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dlls/nodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class CGraph
216216
inline CNode &Node( int i )
217217
{
218218
#if _DEBUG
219-
if ( !m_pNodes || i < 0 || i > m_cNodes )
219+
if ( !m_pNodes || i < 0 || i >= m_cNodes )
220220
ALERT( at_error, "Bad Node!\n" );
221221
#endif
222222
return m_pNodes[i];
@@ -225,7 +225,7 @@ class CGraph
225225
inline CLink &Link( int i )
226226
{
227227
#if _DEBUG
228-
if ( !m_pLinkPool || i < 0 || i > m_cLinks )
228+
if ( !m_pLinkPool || i < 0 || i >= m_cLinks )
229229
ALERT( at_error, "Bad link!\n" );
230230
#endif
231231
return m_pLinkPool[i];

0 commit comments

Comments
 (0)