]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cgi-bin/help-index.c: Check node->section before using it in strcmp() 81/head
authorZdenek Dohnal <zdohnal@redhat.com>
Fri, 29 Jan 2021 07:56:17 +0000 (08:56 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Fri, 29 Jan 2021 07:56:17 +0000 (08:56 +0100)
Fixes a segfault in help.cgi, which happens if user tries to search in man pages.
Fedora bug #1921881

CHANGES-OPENPRINTING.md
cgi-bin/help-index.c

index cf26c8df41ea01a7d5d2fa61fe6ca96b3e94ae27..1eaabcb7ca1465e861307cee7ca07f88f3639ec8 100644 (file)
@@ -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
index ce97e47a43e3777f29bc8abdd048b7b59ac79a04..3da1010e6a2985c7520e39381f8cd39bb3c6c9b1 100644 (file)
@@ -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;