From b37d86b995e232b7351b100c92bf6e9c949e1914 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Thu, 17 Oct 2024 20:53:32 -0400 Subject: [PATCH] Fix nodes and links bounds check. --- dlls/nodes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/nodes.h b/dlls/nodes.h index cb19aeb844..becfd07bc8 100644 --- a/dlls/nodes.h +++ b/dlls/nodes.h @@ -216,7 +216,7 @@ class CGraph inline CNode &Node( int i ) { #if _DEBUG - if ( !m_pNodes || i < 0 || i > m_cNodes ) + if ( !m_pNodes || i < 0 || i >= m_cNodes ) ALERT( at_error, "Bad Node!\n" ); #endif return m_pNodes[i]; @@ -225,7 +225,7 @@ class CGraph inline CLink &Link( int i ) { #if _DEBUG - if ( !m_pLinkPool || i < 0 || i > m_cLinks ) + if ( !m_pLinkPool || i < 0 || i >= m_cLinks ) ALERT( at_error, "Bad link!\n" ); #endif return m_pLinkPool[i];