From: John Darrington <john@cellform.com>
Date: Sun, 26 Feb 2023 10:21:24 +0000 (+0100)
Subject: Avoid another possible null pointer dereference
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2512fa639d23c62104e38e2e125f538c325fc72;p=pspp

Avoid another possible null pointer dereference

* modified:   tests/output/tex-strings.c
---

diff --git a/tests/output/tex-strings.c b/tests/output/tex-strings.c
index 71aed14307..acc2479ce4 100644
--- a/tests/output/tex-strings.c
+++ b/tests/output/tex-strings.c
@@ -108,7 +108,7 @@ main (int argc, char **argv)
         }
     }
 
-  if (optind >= argc)
+  if (!outfile || optind >= argc)
     {
       fprintf (stderr, "Usage: tex-strings  -o <outfile> <infile1> <infile2> ... <infileN>\n");
       return 1;