7 ms·
This is a bit on the unsafe side since it blindly trusts user input. At minimum, there needs to be some kind of magic number in the struct header to validate it
by reza_n 7y ago
This is a bit on the unsafe side since it blindly trusts user input. At minimum, there needs to be some kind of magic number in the struct header to validate its looking at the right memory. Best case, some kind of pointer accounting. Unfortunately, magic doesn't come for free.
- vardump 7y agoWe can optimize that, just put a function pointer in the beginning that's called every time to validate the string... /s