I encountered this word for the first time in the StackOverflow question "C# Theoretical: Write a JMP to a codecave in asm." I see that according to Wiktionary, a code cave is:
an unused block of memory that someone, typically a software cracker, can use to inject custom programming code to modify the behavior of a program.
Did I find the correct definition? If so, is there any legitimate use for a code cave?
One might wish to intentionally create a code cave as a part of using self-modifying code.
Assuming, of course, that one is insane.