Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 4943cd111874246a32af7558e92aab7d > files > 20

man2html-1.6-10.g.fc18.src.rpm

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 {