Hacker News new | ask | show | jobs
by reza_n 2384 days 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.
1 comments

We can optimize that, just put a function pointer in the beginning that's called every time to validate the string... /s