diff --git a/docs/Debugger_Changelog.txt b/docs/Debugger_Changelog.txt index 9ca67271..8b8442c9 100644 --- a/docs/Debugger_Changelog.txt +++ b/docs/Debugger_Changelog.txt @@ -1,4 +1,7 @@ /* +.12 Fixed: [PVS-Studio] Fixed false positive of buffer overflow with MIP_RANDOM +.11 Fixed: [PVS-Studio] Fixed missing call to sprintf() in ConfigSave_PrepareHeader() +.10 Fixed: [PVS-Studio] Fixed no-op in _6502_GetStackReturnAddress() .9 Added: BLOAD now recognizes the extensions .hgr or .hgr2 to load to $2000, or $4000 respectfully .8 Fixed: Showing/hiding the address and/or opcodes will show long symbolic targets without overflowing into the register info pane Bug #227 .7 Fixed: ASC #:# with string containing null byte wouldn't show rest of string diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 01008208..ddc1b7bc 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -47,7 +47,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define ALLOW_INPUT_LOWERCASE 1 // See /docs/Debugger_Changelog.txt for full details - const int DEBUGGER_VERSION = MAKE_VERSION(2,8,0,9); + const int DEBUGGER_VERSION = MAKE_VERSION(2,8,0,12); // Public _________________________________________________________________________________________ @@ -2300,7 +2300,7 @@ void ConfigSave_PrepareHeader ( const Parameters_e eCategory, const Commands_e e sprintf( sText, "%s %s = %s\n" , g_aTokens[ TOKEN_COMMENT_EOL ].sToken , g_aParameters[ PARAM_CATEGORY ].m_sName - , g_aParameters[ eCategory ] + , g_aParameters[ eCategory ].m_sName ); g_ConfigState.PushLine( sText ); @@ -5591,6 +5591,7 @@ Update_t CmdOutputPrintf (int nArgs) { case '\\': eThis = PS_ESCAPE; + break; case '%': eThis = PS_TYPE; break; diff --git a/source/Debugger/Debugger_Assembler.cpp b/source/Debugger/Debugger_Assembler.cpp index 63a46f81..4c2730cd 100644 --- a/source/Debugger/Debugger_Assembler.cpp +++ b/source/Debugger/Debugger_Assembler.cpp @@ -565,7 +565,6 @@ bool _6502_GetStackReturnAddress ( WORD & nAddress_ ) if (nStack <= (_6502_STACK_END - 1)) { - nAddress_ = 0; nAddress_ = (unsigned)*(LPBYTE)(mem + nStack); nStack++; diff --git a/source/Memory.cpp b/source/Memory.cpp index 2f214cec..4cdbbda6 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -1391,14 +1391,14 @@ void MemReset() break; case MIP_RANDOM: - unsigned char random[ 256 + 4 ]; + unsigned char random[ 256 ]; for( iByte = 0x0000; iByte < 0xC000; iByte += 256 ) { for( int i = 0; i < 256; i++ ) { clock = getRandomTime(); - random[ i+0 ] ^= (clock >> 0) & 0xFF; - random[ i+1 ] ^= (clock >> 11) & 0xFF; + random[ (i+0) & 0xFF ] ^= (clock >> 0) & 0xFF; + random[ (i+1) & 0xFF ] ^= (clock >> 11) & 0xFF; } memcpy( &memmain[ iByte ], random, 256 );