It is strange people often forget to do path-sanitization, or just avoid it by completly deniying it or trying to solve problem with `chroot` or something like that. It's like one function that cuts out '/../' and '/./' and then compresses '//' strings, you don't even need to allocate any more memory for that.