If you were trying to prevent a buffer overflow attack for a C program that you were writing, you would simply modify your code to be safer. However, what if you were just given a binary executable, made from C source code, that was susceptible to buffer overflow attacks (which you could cause by using objdump and smashing the stack). If you didn't have access to the source code for said executable, what are some methods you could use to stop your attack from working?
Edit: When you run the executable, you are prompted for a file name to compress. You give it the file name and it zips it up for you.
write a wrapper program that pipes the input and output for 'badprog' through it and ensure the correct lengths and / or contents of the inputs