Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed stack memory corruption due to strcat() function (#21)
* Fixed memory corruption due to strcat() function - The problem with memory stack corruption occurred in the 'fetch_saveimagepath()' function when starting the emulator. Because the memory allocated on the stack `TCHAR path[MAX_DPATH]` in function `DISK_get_default_saveimagepath` does not have a end of line marker ('/0'). That's why further call of the strcat() function which first searches for a zero byte and then adds another string to it resulted in stack corruption in this place and application crash as a consequence. - In other similar functions, the same scenario is possible. * Update dummy.cpp Compilation error, I forgot to specify the variable name * Fixed memory corruption due to strcat() function - The problem with memory stack corruption occurred in the 'fetch_saveimagepath()' function when starting the emulator. Because the memory allocated on the stack `TCHAR path[MAX_DPATH]` in function `DISK_get_default_saveimagepath` does not have a end of line marker ('/0'). That's why further call of the strcat() function which first searches for a zero byte and then adds another string to it resulted in stack corruption in this place and application crash as a consequence. - In other similar functions, the same scenario is possible. * Fix crash if host processor doesn't support 'movbe' SSE3 extension - My Intel processor 2011 does not support SSE3 extensions, in particular 'movbe' instruction. As a result, the emulator crashes with the error 'illegal instruction' Therefore, I would recommend leaving the original #ifdef HAVE_MOVBE * Refactor to pass .clangformat test
- Loading branch information