File: 019-man2html-noindex-segfault.patch

package info (click to toggle)
man2html 1.6f%2Brepack-1%2Bsqueeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,416 kB
  • ctags: 2,894
  • sloc: ansic: 9,558; sh: 2,301; makefile: 343; perl: 335; awk: 305; lisp: 171; cs: 170
file content (24 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Fix segfault on man pages with no sections (see bug #349907).

diff -ruN -x config.guess -x config.sub man-1.6e-old/man2html/man2html.c man-1.6e/man2html/man2html.c
--- man-1.6e-old/man2html/man2html.c	2007-01-31 01:30:17.000000000 +0100
+++ man-1.6e/man2html/man2html.c	2007-01-31 01:30:18.000000000 +0100
@@ -3256,11 +3256,13 @@
     out_html(NEWLINE);
     if (output_possible) {
 	/*   for mosaic users */
-	printf("<HR>\n<A NAME=\"index\">&nbsp;</A><H2>Index</H2>\n<DL>\n");
-	manidx[mip]=0;
-	printf("%s", manidx);
-	if (subs) printf("</DL>\n");
-	printf("</DL>\n");
+	if (manidx) {
+	    printf("<HR>\n<A NAME=\"index\">&nbsp;</A><H2>Index</H2>\n<DL>\n");
+	    manidx[mip]=0;
+	    printf("%s", manidx);
+	    if (subs) printf("</DL>\n");
+	    printf("</DL>\n");
+	}
 	print_sig();
 	printf("</BODY>\n</HTML>\n");
     } else {