Tag Info

New answers tagged

1

This is not a buffer overflow. The buffer size you are giving to memset is exactly the actual size of the buffer (in this case, the object op). If this is a C++ object with virtual functions, then the memset will zero memory that should not have been zeroed, and the call to the destructor is likely to blow up. But this would be memory corruption, not a ...


0

It depends on the definition of MyObject. Since it's C++, the constructor has set up the initial values which you then overwrite using memset. The destructor will assume you have not overwritten the object, and could exhibit all kinds of unintended behavior. But since you don't show any of that code, we have to assume the worst. Memory overflows are quite ...


0

Ignore me, I'm an idiot. Mark points out that MyObject op is a local-scope instantiation of a class, which will be placed on the stack. This means that &op is actually the address of the class data in memory. As such, I have no idea why this was flagged. False positive, maybe? It's right to complain, so let's take a look at this code. What does it ...



Top 50 recent answers are included