]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/unit.c
core/unit: delay creating a stack variable until after length has been checked 8461/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 18 Mar 2018 11:51:31 +0000 (12:51 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 18 Mar 2018 20:07:01 +0000 (21:07 +0100)
commitca8700e922e280beeb3c5f37a967c21739da0f25
treedcc05ff39dc6d69b1cf8b5d18b8b7e8a02311827
parentbd0763b642055647be789b30c393c5e93b046336
core/unit: delay creating a stack variable until after length has been checked

path_is_normalized() will reject paths longer than 4095 bytes, so it's better
to not create a stack variable of unbounded size, but instead do the check first
and only then do that allocation.

Also use _cleanup_ to make things a bit shorter.

https://oss-fuzz.com/v2/issue/5424177403133952/7000
src/core/unit.c