How to handle memcpy exception?
Newb here, proceed with caution!
In some code on a server where I work, we found that an exception occurs on a line with memcpy. The reason is that the source buffer (when all the stars were aligned just right) had FAR more characters in it than the destination buffer had allocated. So it overwrote something in memory and the application just disappeared with no indication why.
So obviously the lengths should be checked for feasability before attempting the memcpy. However, this was inside a __try __except block but it doesn't seem to have been trapped.
There must be a way to trap for this kind of exception. Where would I go to learn how to set up some better exception handling? Books, on line resources, etc.
There are only 10 kinds of people in this world. Those who understand binary, and those who don't!