init: Fix memory corruption when sanitizing platform paths crpalmer