From 03ef22744110c7169775d06aa9c9a71eec7109c7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 25 May 2007 02:01:50 +0000 Subject: [PATCH] bounds check --- stepmania/src/UnlockManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index 9b18f99619..600146cf0c 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -713,7 +713,7 @@ public: static int GetNumUnlocks( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocks() ); return 1; } static int GetNumUnlocked( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocked() ); return 1; } static int AnyUnlocksToCelebrate( T* p, lua_State *L ) { lua_pushboolean( L, p->AnyUnlocksToCelebrate() ); return 1; } - static int GetUnlockEntry( T* p, lua_State *L ) { int iIndex = IArg(1); p->m_UnlockEntries[iIndex].PushSelf(L); return 1; } + static int GetUnlockEntry( T* p, lua_State *L ) { int iIndex = IArg(1); if( iIndex >= p->m_UnlockEntries.size() ) return 0; p->m_UnlockEntries[iIndex].PushSelf(L); return 1; } static int GetSongsUnlockedByEntryID( T* p, lua_State *L ) { vector apSongs;