From 6dc2f7231b5f03d1b9322725798de16cadd99330 Mon Sep 17 00:00:00 2001
From: Milan Broz <gmazyland@gmail.com>
Date: Mon, 21 Jan 2019 14:07:33 +0100
Subject: [PATCH 208/324] Fix a possible NULL pointer in opt_type.

---
 src/cryptsetup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cryptsetup.c b/src/cryptsetup.c
index 13461b2..f140136 100644
--- a/src/cryptsetup.c
+++ b/src/cryptsetup.c
@@ -2609,7 +2609,7 @@ int main(int argc, const char **argv)
 		poptGetInvocationName(popt_context));
 
 	if ((opt_tcrypt_hidden || opt_tcrypt_system || opt_tcrypt_backup) && strcmp(aname, "tcryptDump") &&
-	    (strcmp(aname, "open") || strcmp(opt_type, "tcrypt")))
+	    (strcmp(aname, "open") || !opt_type || strcmp(opt_type, "tcrypt")))
 		usage(popt_context, EXIT_FAILURE,
 		_("Option --tcrypt-hidden, --tcrypt-system or --tcrypt-backup is supported only for TCRYPT device.\n"),
 		poptGetInvocationName(popt_context));
-- 
2.19.1

