mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
util: another set of CVE-2021-4034 assert()s
It's a good idea that we validate argc/argv when we are supposed to store them away.
This commit is contained in:
committed by
Luca Boccassi
parent
98fd285c28
commit
007e03b284
@@ -9,6 +9,12 @@ extern int saved_argc;
|
||||
extern char **saved_argv;
|
||||
|
||||
static inline void save_argc_argv(int argc, char **argv) {
|
||||
|
||||
/* Protect against CVE-2021-4034 style attacks */
|
||||
assert_se(argc > 0);
|
||||
assert_se(argv);
|
||||
assert_se(argv[0]);
|
||||
|
||||
saved_argc = argc;
|
||||
saved_argv = argv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user