Credits to the T2 project where I got this fix from.
Original log message (r20541):
* hardened the fl_wrapper to not segfault for unbalanced parent
directory (..) references hitting the root (/) node
* fixed the fl_wrapper to also expand current (.) and parent (..)
directory references whithout trailing slash and not leak trailing
slashes