From edeb8af8b8683e889f5816ccdc4f035fde8f3fd1 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 29 Jan 2021 08:56:17 +0100 Subject: [PATCH] cgi-bin/help-index.c: Check node->section before using it in strcmp() Fixes a segfault in help.cgi, which happens if user tries to search in man pages. Fedora bug #1921881 --- CHANGES-OPENPRINTING.md | 1 + cgi-bin/help-index.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES-OPENPRINTING.md b/CHANGES-OPENPRINTING.md index cf26c8df41..1eaabcb7ca 100644 --- a/CHANGES-OPENPRINTING.md +++ b/CHANGES-OPENPRINTING.md @@ -12,6 +12,7 @@ Changes in CUPS v2.3.3op2 - The scheduler's systemd service file now waits for the nslcd service to start (Issue #69) - Root certificates were incorrectly stored in "~/.cups/ssl". +- Fixed segfault in help.cgi when searching in man pages Changes in CUPS v2.3.3op1 diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index ce97e47a43..3da1010e6a 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -579,7 +579,7 @@ helpSearchIndex(help_index_t *hi, /* I - Index */ */ for (; node; node = (help_node_t *)cupsArrayNext(hi->nodes)) - if (section && strcmp(node->section, section)) + if (node->section && section && strcmp(node->section, section)) continue; else if (filename && strcmp(node->filename, filename)) continue; -- 2.47.2