easy fix for clearAssembly() crashes

Sometimes code executes while the memory is being cleared. Keeping the old data instead of clearing it creates a fail-safe in case of this happening.
This commit is contained in:
Mewtality 2022-09-06 12:01:16 +02:00 committed by GitHub
parent 45c4df406f
commit 653e4375e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,15 +26,6 @@ void executeAssembly() {
} }
void clearAssembly() { void clearAssembly() {
log_printf("[Clear assembly] Assembly size: %i\n", assemblySize);
unsigned char buffer[assemblySize];
log_print("[Clear assembly] Buffer allocated\n");
memset((void *) buffer, 0, assemblySize);
log_print("[Clear assembly] Memory set\n");
int startAddress = getStartAddress();
log_printf("[Clear assembly] Start address: %i\n", startAddress);
kernelCopyData((unsigned char *) startAddress, buffer, assemblySize);
log_print("[Clear assembly] Kernel copy done\n");
assemblySize = 0; assemblySize = 0;
log_print("[Clear assembly] Assembly size 0\n"); log_print("[Clear assembly] Assembly size 0\n");
} }