]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ukify: check option length
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Jul 2023 09:47:48 +0000 (18:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Jul 2023 09:48:32 +0000 (18:48 +0900)
Follow-up for df4a46733a609f1673de0bebb38e89fffd70c16c.

src/ukify/ukify.py

index a6a4a38040d092580088b7e153063a4a43241f24..49317fbf784ee3293369a2ad98b4385d81eba464 100755 (executable)
@@ -1484,7 +1484,7 @@ def finalize_options(opts):
     # Figure out which syntax is being used, one of:
     # ukify verb --arg --arg --arg
     # ukify linux initrd…
-    if opts.positional[0] == 'inspect':
+    if len(opts.positional) >= 1 and opts.positional[0] == 'inspect':
         opts.verb = opts.positional[0]
         opts.files = opts.positional[1:]
         if not opts.files: