]> git.ipfire.org Git - thirdparty/systemd.git/commit
tty-ask-password: copy argv[] before forking child
authorLennart Poettering <lennart@poettering.net>
Tue, 2 Apr 2019 08:04:16 +0000 (10:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 2 Apr 2019 08:19:17 +0000 (10:19 +0200)
commited179fd71030ddd657500591dac37e7499fc7b2c
tree2f3beac65129961eeb5491f68a2576f75fba3c63
parent509276f2b7d44d472b66e79cbfa531c1de4c3801
tty-ask-password: copy argv[] before forking child

Another fix in style of bd169c2be0fbdaf6eb2ea7951e650d5e5983fbf6.

Let's also avoid strjoina() in a loop (i.e. stack allocation). While in
this specific caseone could get away with it (since we'd immediately
afterwards leave the loop) it's still ugly, and every static checker
would be totally within its rights to complain.

Also, let's simplify things by not relying on argc, since it's redundant
anyway, and it's nicer to just treat things as NULL terminated strv
array.

Fixes: #12180
src/tty-ask-password-agent/tty-ask-password-agent.c