mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
shared: be extra paranoid and check if argc > 0
and also if argv[0] is non-empty as a precaution for issues similar to CVE-2021-4034.
This commit is contained in:
parent
b97f338e56
commit
1637e75707
@ -15,6 +15,7 @@
|
||||
#define _DEFINE_MAIN_FUNCTION(intro, impl, ret) \
|
||||
int main(int argc, char *argv[]) { \
|
||||
int r; \
|
||||
assert(argc > 0 && !isempty(argv[0])); \
|
||||
save_argc_argv(argc, argv); \
|
||||
intro; \
|
||||
r = impl; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user