Earlier quoted context omitted.
What the hell is systemd doing that a 8MB long file path can exhaust its stack? Is it doing some recursive parsing or is it just doing something plain stupid like using a VLA to store user provided data?
Probably unbounded alloca() as always.
strdupa(input) without any length check
Fix is to replace it with unbounded malloc() instead of checking for sane length first.