diff options
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/basic/util.h b/src/basic/util.h index 94804f28e3..68ae3b51e0 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -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; } |