1
1
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:
Frantisek Sumsal 2022-01-28 21:44:32 +01:00 committed by Yu Watanabe
parent b97f338e56
commit 1637e75707

View File

@ -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; \