Reading outside boundaries does not cause memory corruption.
Adding the function changes the memory layout of the compiled program. And whatever was corrupting your memory is now corrupting another part of your memory.
Reading outside boundaries does not cause memory corruption.
Adding the function changes the memory layout of the compiled program. And whatever was corrupting your memory is now corrupting another part of your memory.