]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
berkeley/lprm.c: Report error if -P doesn't have destination 458/head
authorZdenek Dohnal <zdohnal@redhat.com>
Tue, 16 Aug 2022 11:36:32 +0000 (13:36 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Tue, 16 Aug 2022 11:36:32 +0000 (13:36 +0200)
Fixes #457

berkeley/lprm.c

index 9da1165d797f3d2d1f8d3d63b267119c6febbc5f..18c982d149a12e6cf228162580b19abcfd2532a5 100644 (file)
@@ -82,6 +82,13 @@ main(int  argc,                      /* I - Number of command-line arguments */
              else
              {
                i ++;
+
+               if (i >= argc)
+               {
+                 _cupsLangPrintf(stderr, _("%s: Error - expected destination after \"-P\" option."), argv[0]);
+                 usage();
+               }
+
                name = argv[i];
              }