3 ms·
Because I am the one, my custom malloc checks a given size against the list of known constant string pointers and if it matches, it calls strdup instead. So ea
by pavlov 2y ago
Because I am the one, my custom malloc checks a given size against the list of known constant string pointers and if it matches, it calls strdup instead.
So easy to program defensively in C.
- lambdaxyzw 2y agoI guess you could check if the pointer points inside a data section of your program, and if yes, call strlen on it. It's all so easy!