cups/0001-SIGSEGV-in-CUPS-web-ui-when-adding-a-printer.patch

20 lines
589 B
Diff

From eda46e3aac94d42e4199d95befe99ff83afb098f Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Mon, 29 Jul 2019 10:33:06 +0200
Subject: [PATCH] SIGSEGV in CUPS web ui when adding a printer
diff --git a/cgi-bin/var.c b/cgi-bin/var.c
index 306375bd6..fb9d051c0 100644
--- a/cgi-bin/var.c
+++ b/cgi-bin/var.c
@@ -170,6 +170,9 @@ cgiGetArray(const char *name, /* I - Name of array variable */
if (element < 0 || element >= var->nvalues)
return (NULL);
+ if (var->values[element] == NULL)
+ return (NULL);
+
return (strdup(var->values[element]));
}