cups/0001-Add-check-for-whether-...

36 lines
1.2 KiB
Diff

From 96a6f61db6eb0fc450e00168903b795c57b033cb Mon Sep 17 00:00:00 2001
From: = <awesomepranshu@gmail.com>
Date: Sat, 23 Jan 2021 00:44:09 +0530
Subject: [PATCH] Add check for whether 'option' variable exists or not for
closeUI and JCLCloseUI lines in ppd.c
---
cups/ppd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cups/ppd.c b/cups/ppd.c
index ae411cb3a..a82c8a584 100644
--- a/cups/ppd.c
+++ b/cups/ppd.c
@@ -1496,7 +1496,7 @@ _ppdOpen(
goto error;
}
- if (!_cups_strcasecmp(option->defchoice, "custom") || !_cups_strncasecmp(option->defchoice, "custom.", 7))
+ if (option && (!_cups_strcasecmp(option->defchoice, "custom") || !_cups_strncasecmp(option->defchoice, "custom.", 7)))
{
/*
* "*DefaultOption: Custom..." may set the default to a custom value
@@ -1531,7 +1531,7 @@ _ppdOpen(
goto error;
}
- if (!_cups_strcasecmp(option->defchoice, "custom") || !_cups_strncasecmp(option->defchoice, "custom.", 7))
+ if (option && (!_cups_strcasecmp(option->defchoice, "custom") || !_cups_strncasecmp(option->defchoice, "custom.", 7)))
{
/*
* "*DefaultOption: Custom..." may set the default to a custom value
--
2.26.2