3 ms·
How realloc is insecure ? The only lacking construct is a "moved" operator, which would re-assign pointer members, for example, when moving this to another loca
by xroche 12y ago
How realloc is insecure ? The only lacking construct is a "moved" operator, which would re-assign pointer members, for example, when moving this to another location.
- pjmlp 12y agoTypical security exploit with realloc is attacking code that assumes realloc always success and never moves, thus keeping all pointers around.
- huhtenberg 12y agoAssuming that realloc() always succeeds is one thing, I can believe there's code that makes it. But I'd very much like to look at the code that assumes that realloc() never moves the block. This sounds a remarkably elaborate assumption to make, hardly an oversight due to ignorance.
- pjmlp 12y agoLots of enterprise code with off-shoring provide entertainment of code quality.