]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: check if argc > 0 and argv[0] is set
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 30 Jan 2022 08:54:55 +0000 (17:54 +0900)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 30 Jan 2022 13:07:51 +0000 (13:07 +0000)
Follow-up for 1637e757070a61b12b26a2a4ef547330562dc77f.

src/core/main.c

index 57aedb9b93b459cc5ef95df9c1002d3e6ebfd6a2..fba9a4a8ec3caed7370f0435dac2e80c3c91989e 100644 (file)
@@ -2726,6 +2726,8 @@ int main(int argc, char *argv[]) {
         Manager *m = NULL;
         FDSet *fds = NULL;
 
+        assert(argc > 0 && !isempty(argv[0]));
+
         /* SysV compatibility: redirect init → telinit */
         redirect_telinit(argc, argv);