diff -Nru htmldoc-1.9.15/CHANGES.md htmldoc-1.9.16/CHANGES.md --- htmldoc-1.9.15/CHANGES.md 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/CHANGES.md 2022-05-05 13:37:51.000000000 +0000 @@ -1,3 +1,17 @@ +# Changes in HTMLDOC v1.9.16 + +- Added support for `$DATE(format)` and `$TIME(format)` header/footer strings + (Issue #472) +- Fixed a potential image overflow bug with JPEG and PNG images (Issue #471) +- Fixed potential heap overflow bugs with pages (Issue #477, Issue #478, + Issue #480, Issue #482, Issue #483) +- Fixed potential use-after-free in blocks (Issue #484) +- Updated the GNU TLS HTTPS support code to use a faster connection shutdown + mode (Issue #487) +- Fixed some minor Coverity warnings. +- Updated the GUI interface for current display fonts. + + # Changes in HTMLDOC v1.9.15 - Fixed a potential heap overflow bug with GIF images (Issue #461) diff -Nru htmldoc-1.9.15/configure htmldoc-1.9.16/configure --- htmldoc-1.9.15/configure 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/configure 2022-05-05 13:37:51.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for HTMLDOC 1.9.15. +# Generated by GNU Autoconf 2.71 for HTMLDOC 1.9.16. # # Report bugs to . # @@ -610,8 +610,8 @@ # Identity of this package. PACKAGE_NAME='HTMLDOC' PACKAGE_TARNAME='htmldoc' -PACKAGE_VERSION='1.9.15' -PACKAGE_STRING='HTMLDOC 1.9.15' +PACKAGE_VERSION='1.9.16' +PACKAGE_STRING='HTMLDOC 1.9.16' PACKAGE_BUGREPORT='https://github.com/michaelrsweet/htmldoc/issues' PACKAGE_URL='https://www.msweet.org/htmldoc' @@ -1301,7 +1301,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HTMLDOC 1.9.15 to adapt to many kinds of systems. +\`configure' configures HTMLDOC 1.9.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1367,7 +1367,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HTMLDOC 1.9.15:";; + short | recursive ) echo "Configuration of HTMLDOC 1.9.16:";; esac cat <<\_ACEOF @@ -1469,7 +1469,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HTMLDOC configure 1.9.15 +HTMLDOC configure 1.9.16 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1764,7 +1764,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HTMLDOC $as_me 1.9.15, which was +It was created by HTMLDOC $as_me 1.9.16, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2739,7 +2739,7 @@ -SVERSION="1.9.15" +SVERSION="1.9.16" printf "%s\n" "#define SVERSION \"$SVERSION\"" >>confdefs.h @@ -6960,7 +6960,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HTMLDOC $as_me 1.9.15, which was +This file was extended by HTMLDOC $as_me 1.9.16, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7025,7 +7025,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -HTMLDOC config.status 1.9.15 +HTMLDOC config.status 1.9.16 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -Nru htmldoc-1.9.15/configure.ac htmldoc-1.9.16/configure.ac --- htmldoc-1.9.15/configure.ac 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/configure.ac 2022-05-05 13:37:51.000000000 +0000 @@ -1,7 +1,7 @@ dnl -dnl Con])guration script for HTMLDOC, an HTML document processing program. +dnl Configuration script for HTMLDOC, an HTML document processing program. dnl -dnl Copyright © 2011-2021 by Michael R Sweet. +dnl Copyright © 2011-2022 by Michael R Sweet. dnl Copyright © 1997-2010 by Easy Software Products. dnl dnl This program is free software. Distribution and use rights are outlined in @@ -21,7 +21,7 @@ AC_PREREQ([2.69]) -AC_INIT([HTMLDOC], [1.9.15], [https://github.com/michaelrsweet/htmldoc/issues], [htmldoc], [https://www.msweet.org/htmldoc]) +AC_INIT([HTMLDOC], [1.9.16], [https://github.com/michaelrsweet/htmldoc/issues], [htmldoc], [https://www.msweet.org/htmldoc]) AC_CONFIG_HEADERS([config.h]) diff -Nru htmldoc-1.9.15/debian/changelog htmldoc-1.9.16/debian/changelog --- htmldoc-1.9.15/debian/changelog 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/changelog 2022-06-08 18:59:05.000000000 +0000 @@ -1,3 +1,13 @@ +htmldoc (1.9.16-1) unstable; urgency=medium + + * New upstream version 1.9.16 + * Rebase patches. + * Update Standards-Version to 4.6.1, no changes needed. + * Only provide documentation as html. + Rename d/p/manpage-fixes.patch -> d/p/build_documentation.patch + + -- Håvard F. Aasen Wed, 08 Jun 2022 20:59:05 +0200 + htmldoc (1.9.15-2) unstable; urgency=medium * Add upstream patch for CVE-2022-28085 and CVE-2022-27114 diff -Nru htmldoc-1.9.15/debian/control htmldoc-1.9.16/debian/control --- htmldoc-1.9.15/debian/control 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/control 2022-06-08 18:59:05.000000000 +0000 @@ -10,7 +10,7 @@ libxpm-dev, pkg-config, zlib1g-dev, -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Homepage: https://www.msweet.org/htmldoc/ Vcs-Browser: https://salsa.debian.org/haava/htmldoc Vcs-Git: https://salsa.debian.org/haava/htmldoc.git diff -Nru htmldoc-1.9.15/debian/htmldoc-common.doc-base htmldoc-1.9.16/debian/htmldoc-common.doc-base --- htmldoc-1.9.15/debian/htmldoc-common.doc-base 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/htmldoc-common.doc-base 2022-06-08 18:59:05.000000000 +0000 @@ -6,9 +6,3 @@ Format: HTML Index: /usr/share/doc/htmldoc/htmldoc.html Files: /usr/share/doc/htmldoc/htmldoc.html - -Format: PDF -Files: /usr/share/doc/htmldoc/htmldoc.pdf.gz - -Format: PostScript -Files: /usr/share/doc/htmldoc/htmldoc.ps.gz diff -Nru htmldoc-1.9.15/debian/patches/autoconf_fixes.patch htmldoc-1.9.16/debian/patches/autoconf_fixes.patch --- htmldoc-1.9.15/debian/patches/autoconf_fixes.patch 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/autoconf_fixes.patch 2022-06-08 18:59:05.000000000 +0000 @@ -11,7 +11,7 @@ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac -index e9e285b..1faab58 100644 +index 7fa027a..0bb9616 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ AC_CONFIG_HEADERS([config.h]) diff -Nru htmldoc-1.9.15/debian/patches/autoheader_support.patch htmldoc-1.9.16/debian/patches/autoheader_support.patch --- htmldoc-1.9.15/debian/patches/autoheader_support.patch 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/autoheader_support.patch 2022-06-08 18:59:05.000000000 +0000 @@ -13,7 +13,7 @@ 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac -index 1faab58..6dc856b 100644 +index 0bb9616..7aa4ba8 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,10 @@ dnl Checks for string functions. diff -Nru htmldoc-1.9.15/debian/patches/build_documentation.patch htmldoc-1.9.16/debian/patches/build_documentation.patch --- htmldoc-1.9.15/debian/patches/build_documentation.patch 1970-01-01 00:00:00.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/build_documentation.patch 2022-06-08 18:59:05.000000000 +0000 @@ -0,0 +1,25 @@ +From: Jeff Licquia +Date: Sat, 21 Dec 2019 22:31:04 +0100 +Subject: Documentation fixes + +Only build documentation in html + +Forwarded: not-needed +Last-Update: 2022-06-08 +--- + doc/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/doc/Makefile b/doc/Makefile +index b332dec..e9e9096 100644 +--- a/doc/Makefile ++++ b/doc/Makefile +@@ -28,7 +28,7 @@ SOURCES = 1-intro.html \ + b-book.html + + DOCUMENTS = htmldoc.epub htmldoc.html htmldoc.pdf htmldoc.ps +-DOCFILES = help.html htmldoc.pdf ++DOCFILES = help.html htmldoc.html + + HTMLDOC = ../htmldoc/htmldoc$(EXEEXT) --datadir .. --strict + diff -Nru htmldoc-1.9.15/debian/patches/Call-check_pages-when-writing-links-Issue-480.patch htmldoc-1.9.16/debian/patches/Call-check_pages-when-writing-links-Issue-480.patch --- htmldoc-1.9.15/debian/patches/Call-check_pages-when-writing-links-Issue-480.patch 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/Call-check_pages-when-writing-links-Issue-480.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From: Michael R Sweet -Date: Thu, 24 Mar 2022 16:30:07 -0400 -Subject: Call check_pages when writing links (Issue #480) - -CVE-2022-28085 - -Origin: upstream, https://github.com/michaelrsweet/htmldoc/commit/46c8ec2b9bccb8ccabff52d998c5eee77a228348 ---- - htmldoc/ps-pdf.cxx | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/htmldoc/ps-pdf.cxx b/htmldoc/ps-pdf.cxx -index 817b35a..d8175bf 100644 ---- a/htmldoc/ps-pdf.cxx -+++ b/htmldoc/ps-pdf.cxx -@@ -3583,6 +3583,8 @@ pdf_write_names(FILE *out) /* I - Output file */ - pdf_start_object(out); - float x, y; - -+ check_pages(link->page); -+ - x = 0.0f; - y = link->top + pages[link->page].bottom; - pspdf_transform_coords(pages + link->page, x, y); diff -Nru htmldoc-1.9.15/debian/patches/enforce-utf8-doc.patch htmldoc-1.9.16/debian/patches/enforce-utf8-doc.patch --- htmldoc-1.9.15/debian/patches/enforce-utf8-doc.patch 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/enforce-utf8-doc.patch 2022-06-08 18:59:05.000000000 +0000 @@ -4,13 +4,13 @@ htmldoc cannot convert the copyright symbol to utf8. Forwarded: not-needed -Last-Update: 2021-12-25 +Last-Update: 2022-05-21 --- doc/1-intro.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/1-intro.html b/doc/1-intro.html -index e58737e..a14c763 100644 +index 3c4419a..7bda43a 100644 --- a/doc/1-intro.html +++ b/doc/1-intro.html @@ -1,7 +1,7 @@ @@ -19,6 +19,6 @@ - + - + HTMLDOC Users Manual diff -Nru htmldoc-1.9.15/debian/patches/Fix-a-potential-integer-overflow-bug-in-the-JPEG-and-PNG-.patch htmldoc-1.9.16/debian/patches/Fix-a-potential-integer-overflow-bug-in-the-JPEG-and-PNG-.patch --- htmldoc-1.9.15/debian/patches/Fix-a-potential-integer-overflow-bug-in-the-JPEG-and-PNG-.patch 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/Fix-a-potential-integer-overflow-bug-in-the-JPEG-and-PNG-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -From: Michael R Sweet -Date: Thu, 10 Mar 2022 15:29:36 -0500 -Subject: Fix a potential integer overflow bug in the JPEG and PNG loaders - (Issue #471) - -All images are now limited to 4GiB of memory usage (37837x37837 pixels). - -CVE-2022-27114 - -Origin: upstream, https://github.com/michaelrsweet/htmldoc/commit/31f780487e5ddc426888638786cdc47631687275 ---- - htmldoc/image.cxx | 25 ++++++++++++++++++++++--- - 1 file changed, 22 insertions(+), 3 deletions(-) - -diff --git a/htmldoc/image.cxx b/htmldoc/image.cxx -index 550b0f9..890f99f 100644 ---- a/htmldoc/image.cxx -+++ b/htmldoc/image.cxx -@@ -26,6 +26,13 @@ extern "C" { /* Workaround for JPEG header problems... */ - #endif // HAVE_LIBPNG - - -+/* -+ * Limits... -+ */ -+ -+#define IMAGE_MAX_DIM 37837 // Maximum dimension - sqrt(4GiB / 3) -+ -+ - /* - * GIF definitions... - */ -@@ -926,7 +933,7 @@ image_load_bmp(image_t *img, /* I - Image to load into */ - colors_used = (int)read_dword(fp); - read_dword(fp); - -- if (img->width <= 0 || img->width > 8192 || img->height <= 0 || img->height > 8192 || info_size < 0) -+ if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM || info_size < 0) - return (-1); - - if (info_size > 40) -@@ -1278,7 +1285,7 @@ image_load_gif(image_t *img, /* I - Image pointer */ - img->height = (buf[9] << 8) | buf[8]; - ncolors = 2 << (buf[10] & 0x07); - -- if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->height > 32767) -+ if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) - return (-1); - - // If we are writing an encrypted PDF file, bump the use count so we create -@@ -1326,7 +1333,7 @@ image_load_gif(image_t *img, /* I - Image pointer */ - img->height = (buf[7] << 8) | buf[6]; - img->depth = gray ? 1 : 3; - -- if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->height > 32767) -+ if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) - return (-1); - - if (transparent >= 0) -@@ -1443,6 +1450,12 @@ JSAMPROW row; /* Sample row pointer */ - img->height = (int)cinfo.output_height; - img->depth = (int)cinfo.output_components; - -+ if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) -+ { -+ jpeg_destroy_decompress(&cinfo); -+ return (-1); -+ } -+ - if (!load_data) - { - jpeg_destroy_decompress(&cinfo); -@@ -1598,6 +1611,12 @@ image_load_png(image_t *img, /* I - Image pointer */ - img->width = (int)png_get_image_width(pp, info); - img->height = (int)png_get_image_height(pp, info); - -+ if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) -+ { -+ png_destroy_read_struct(&pp, &info, NULL); -+ return (-1); -+ } -+ - if (color_type & PNG_COLOR_MASK_ALPHA) - { - if ((PSLevel == 0 && PDFVersion >= 14) || PSLevel == 3) diff -Nru htmldoc-1.9.15/debian/patches/manpage-fixes.patch htmldoc-1.9.16/debian/patches/manpage-fixes.patch --- htmldoc-1.9.15/debian/patches/manpage-fixes.patch 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/manpage-fixes.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From: Jeff Licquia -Date: Sat, 21 Dec 2019 22:31:04 +0100 -Subject: Documentation fixes - -Forwarded: not-needed - -This patch gives us a complete documentation build ---- - doc/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/Makefile b/doc/Makefile -index b332dec..c0dea92 100644 ---- a/doc/Makefile -+++ b/doc/Makefile -@@ -28,7 +28,7 @@ SOURCES = 1-intro.html \ - b-book.html - - DOCUMENTS = htmldoc.epub htmldoc.html htmldoc.pdf htmldoc.ps --DOCFILES = help.html htmldoc.pdf -+DOCFILES = help.html htmldoc.pdf htmldoc.html htmldoc.ps - - HTMLDOC = ../htmldoc/htmldoc$(EXEEXT) --datadir .. --strict - diff -Nru htmldoc-1.9.15/debian/patches/series htmldoc-1.9.16/debian/patches/series --- htmldoc-1.9.15/debian/patches/series 2022-05-12 19:33:29.000000000 +0000 +++ htmldoc-1.9.16/debian/patches/series 2022-06-08 18:59:05.000000000 +0000 @@ -1,8 +1,6 @@ enforce-utf8-doc.patch -manpage-fixes.patch +build_documentation.patch useful-build-info.patch autoconf_fixes.patch autoheader_support.patch remove-os-check.patch -Call-check_pages-when-writing-links-Issue-480.patch -Fix-a-potential-integer-overflow-bug-in-the-JPEG-and-PNG-.patch diff -Nru htmldoc-1.9.15/doc/1-intro.html htmldoc-1.9.16/doc/1-intro.html --- htmldoc-1.9.15/doc/1-intro.html 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/doc/1-intro.html 2022-05-05 13:37:51.000000000 +0000 @@ -2,7 +2,7 @@ - + HTMLDOC Users Manual diff -Nru htmldoc-1.9.15/doc/4-htmlref.html htmldoc-1.9.16/doc/4-htmlref.html --- htmldoc-1.9.15/doc/4-htmlref.html 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/doc/4-htmlref.html 2022-05-05 13:37:51.000000000 +0000 @@ -298,7 +298,10 @@
$DATE -
Inserts the current date. +
$DATE(format) +
Inserts the current date. See Date/Time + Formats for details on the format string. When no format is + supplied, the default date format for the current locale is used.
$HEADING @@ -348,7 +351,10 @@
$TIME -
Inserts the current time. +
$TIME(format) +
Inserts the current time. See Date/Time + Formats for details on the format string. When no format is + supplied, the default time format for the current locale is used.
$TITLE @@ -360,6 +366,47 @@ +

Date/Time Formats

+ +

The $DATE and $TIME header/footer strings support +an optional format string in parenthesis. Letters represent date/time values +while other characters are inserted verbatim. The following letters are +supported:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LetterDescription
AFull weekday name
aAbbreviated weekday name
BFull month name
bAbbreviated month name
CCentury (CC)
cDefault date and time format
dDay of the month ("01" to "31")
eDay of the month (" 1" to "31")
FYYYY-MM-DD
HHours for 24-hour clock ("00" to "23")
IHours for 12-hour clock ("01" to "12")
jDay of the year ("001" to "366")
kHours for 24-hour clock (" 0" to "23")
lHours for 12-hour clock (" 1" to "12")
MMinutes ("00" to "59")
mMonth number ("01" to "12")
p"am" or "pm"
RHours and minutes ("HH:MM")
rHours, minutes, seconds, and am/pm ("HH:MM:SS am/pm")
SSeconds ("00" to "60")
THours, minutes, and seconds ("HH:MM:SS")
XDefault time format
xDefault date format
YYear with century (CCYY)
yYear without century (YY)
ZTime zone name
zTime zone offset from UTC
+
+ +

FONT Attributes

diff -Nru htmldoc-1.9.15/doc/htmldoc.man htmldoc-1.9.16/doc/htmldoc.man --- htmldoc-1.9.15/doc/htmldoc.man 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/doc/htmldoc.man 2022-05-05 13:37:51.000000000 +0000 @@ -1,13 +1,13 @@ .\" .\" Manual page for HTMLDOC, a HTML document processing program. .\" -.\" Copyright 2011-2021 by Michael R Sweet. +.\" Copyright 2011-2022 by Michael R Sweet. .\" Copyright 1997-2010 by msweet.org. .\" .\" This program is free software. Distribution and use rights are outlined .\" in the file "COPYING". .\" -.TH htmldoc 1 "HTMLDOC 1.9.13" "2021-11-05" "Michael R Sweet" +.TH htmldoc 1 "HTMLDOC 1.9.16" "2022-02-07" "Michael R Sweet" .SH NAME htmldoc \- convert html source files into html, postscript, or pdf. .SH SYNOPSIS @@ -429,7 +429,7 @@ .SH AUTHOR Michael R Sweet .SH LEGAL STUFF -HTMLDOC is copyright \[co] 1997-2021 by Michael R Sweet. +HTMLDOC is copyright \[co] 1997-2022 by Michael R Sweet. .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free diff -Nru htmldoc-1.9.15/htmldoc/gui.cxx htmldoc-1.9.16/htmldoc/gui.cxx --- htmldoc-1.9.15/htmldoc/gui.cxx 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/htmldoc/gui.cxx 2022-05-05 13:37:51.000000000 +0000 @@ -1,7 +1,7 @@ // // GUI routines for HTMLDOC, an HTML document processing program. // -// Copyright © 2011-2021 by Michael R Sweet. +// Copyright © 2011-2022 by Michael R Sweet. // Copyright © 1997-2010 by Easy Software Products. All rights reserved. // // This program is free software. Distribution and use rights are outlined in @@ -234,100 +234,100 @@ // Create a dialog window... // - window = new Fl_Double_Window(505, 400, "HTMLDOC " SVERSION); + window = new Fl_Double_Window(640, 400, "HTMLDOC " SVERSION); window->callback((Fl_Callback *)closeBookCB, this); - controls = new Fl_Group(0, 0, 505, 360); - tabs = new Fl_Tabs(10, 10, 485, 315); + controls = new Fl_Group(0, 0, 640, 360); + tabs = new Fl_Tabs(10, 10, 620, 315); // // Input tab... // - inputTab = new Fl_Group(10, 35, 485, 290, "Input"); + inputTab = new Fl_Group(10, 35, 620, 290, "Input"); - group = new Fl_Group(140, 45, 250, 20, "Document Type: "); + group = new Fl_Group(180, 45, 250, 20, "Document Type: "); group->align(FL_ALIGN_LEFT); - typeBook = new Fl_Round_Button(140, 45, 60, 20, "Book"); + typeBook = new Fl_Round_Button(180, 45, 60, 20, "Book"); typeBook->type(FL_RADIO_BUTTON); typeBook->setonly(); typeBook->callback((Fl_Callback *)docTypeCB, this); typeBook->tooltip("Convert chapters into a book."); - typeContinuous = new Fl_Round_Button(200, 45, 100, 20, "Continuous"); + typeContinuous = new Fl_Round_Button(240, 45, 100, 20, "Continuous"); typeContinuous->type(FL_RADIO_BUTTON); typeContinuous->callback((Fl_Callback *)docTypeCB, this); typeContinuous->tooltip("Convert web pages without page breaks."); - typeWebPage = new Fl_Round_Button(300, 45, 90, 20, "Web Page"); + typeWebPage = new Fl_Round_Button(340, 45, 90, 20, "Web Page"); typeWebPage->type(FL_RADIO_BUTTON); typeWebPage->callback((Fl_Callback *)docTypeCB, this); typeWebPage->tooltip("Convert web pages with page breaks."); group->end(); - group = new Fl_Group(140, 70, 250, 20, "Input Files: "); + group = new Fl_Group(180, 70, 250, 20, "Input Files: "); group->align(FL_ALIGN_LEFT); group->end(); - inputFiles = new Fl_File_Browser(140, 70, 250, 150); + inputFiles = new Fl_File_Browser(180, 70, 340, 150); inputFiles->iconsize(20); inputFiles->type(FL_MULTI_BROWSER); inputFiles->callback((Fl_Callback *)inputFilesCB, this); inputFiles->when(FL_WHEN_RELEASE | FL_WHEN_NOT_CHANGED); inputFiles->tooltip("This is the list of HTML files and URLs that will be converted."); - addFile = new Fl_Button(390, 70, 95, 25, "Add Files..."); + addFile = new Fl_Button(520, 70, 100, 25, "Add Files..."); addFile->callback((Fl_Callback *)addFileCB, this); addFile->tooltip("Add HTML files to the list."); - addURL = new Fl_Button(390, 95, 95, 25, "Add URL..."); + addURL = new Fl_Button(520, 95, 100, 25, "Add URL..."); addURL->callback((Fl_Callback *)addURLCB, this); addURL->tooltip("Add a URL to the list."); - editFile = new Fl_Button(390, 120, 95, 25, "Edit Files..."); + editFile = new Fl_Button(520, 120, 100, 25, "Edit Files..."); editFile->deactivate(); editFile->callback((Fl_Callback *)editFilesCB, this); editFile->tooltip("Edit HTML files in the list."); - deleteFile = new Fl_Button(390, 145, 95, 25, "Delete Files"); + deleteFile = new Fl_Button(520, 145, 100, 25, "Delete Files"); deleteFile->deactivate(); deleteFile->callback((Fl_Callback *)deleteFilesCB, this); deleteFile->tooltip("Remove HTML files and URLs from the list."); - moveUpFile = new Fl_Button(390, 170, 95, 25, "Move Up"); + moveUpFile = new Fl_Button(520, 170, 100, 25, "Move Up"); moveUpFile->deactivate(); moveUpFile->callback((Fl_Callback *)moveUpFilesCB, this); moveUpFile->tooltip("Move HTML files and URLs up in the list."); - moveDownFile = new Fl_Button(390, 195, 95, 25, "Move Down"); + moveDownFile = new Fl_Button(520, 195, 100, 25, "Move Down"); moveDownFile->deactivate(); moveDownFile->callback((Fl_Callback *)moveDownFilesCB, this); moveDownFile->tooltip("Move HTML files and URLs down in the list."); - lhImage = new Fl_Input(140, 230, 250, 25, "Letterhead Image: "); + lhImage = new Fl_Input(180, 230, 340, 25, "Letterhead Image: "); lhImage->when(FL_WHEN_CHANGED); lhImage->callback((Fl_Callback *)lhImageCB, this); lhImage->tooltip("The letterhead image for the header or footer."); - lhBrowse = new Fl_Button(390, 230, 95, 25, "Browse..."); + lhBrowse = new Fl_Button(520, 230, 100, 25, "Browse..."); lhBrowse->callback((Fl_Callback *)lhImageCB, this); lhBrowse->tooltip("Choose a logo image file."); - logoImage = new Fl_Input(140, 260, 250, 25, "Logo Image: "); + logoImage = new Fl_Input(180, 260, 340, 25, "Logo Image: "); logoImage->when(FL_WHEN_CHANGED); logoImage->callback((Fl_Callback *)logoImageCB, this); logoImage->tooltip("The logo image for the navigation bar and header or footer."); - logoBrowse = new Fl_Button(390, 260, 95, 25, "Browse..."); + logoBrowse = new Fl_Button(520, 260, 100, 25, "Browse..."); logoBrowse->callback((Fl_Callback *)logoImageCB, this); logoBrowse->tooltip("Choose a logo image file."); - titleImage = new Fl_Input(140, 290, 250, 25, "Title File/Image: "); + titleImage = new Fl_Input(180, 290, 340, 25, "Title File/Image: "); titleImage->when(FL_WHEN_CHANGED); titleImage->callback((Fl_Callback *)titleImageCB, this); titleImage->tooltip("The title image or HTML file for the title page."); - titleBrowse = new Fl_Button(390, 290, 95, 25, "Browse..."); + titleBrowse = new Fl_Button(520, 290, 100, 25, "Browse..."); titleBrowse->callback((Fl_Callback *)titleImageCB, this); titleBrowse->tooltip("Choose a title file."); @@ -338,81 +338,81 @@ // Output tab... // - outputTab = new Fl_Group(10, 35, 485, 290, "Output"); + outputTab = new Fl_Group(10, 35, 620, 290, "Output"); outputTab->hide(); - group = new Fl_Group(140, 45, 265, 20, "Output To: "); + group = new Fl_Group(180, 45, 265, 20, "Output To: "); group->align(FL_ALIGN_LEFT); - outputFile = new Fl_Round_Button(140, 45, 50, 20, "File"); + outputFile = new Fl_Round_Button(180, 45, 50, 20, "File"); outputFile->type(FL_RADIO_BUTTON); outputFile->setonly(); outputFile->callback((Fl_Callback *)outputTypeCB, this); outputFile->tooltip("Generate a single output file."); - outputDirectory = new Fl_Round_Button(190, 45, 105, 20, "Directory"); + outputDirectory = new Fl_Round_Button(230, 45, 105, 20, "Directory"); outputDirectory->type(FL_RADIO_BUTTON); outputDirectory->callback((Fl_Callback *)outputTypeCB, this); outputDirectory->tooltip("Generate multiple output files in a directory."); group->end(); - outputPath = new Fl_Input(140, 70, 250, 25, "Output Path: "); + outputPath = new Fl_Input(180, 75, 340, 25, "Output Path: "); outputPath->when(FL_WHEN_CHANGED); outputPath->callback((Fl_Callback *)outputPathCB, this); outputPath->tooltip("The name of the output file or directory."); - outputBrowse = new Fl_Button(390, 70, 95, 25, "Browse..."); + outputBrowse = new Fl_Button(520, 75, 100, 25, "Browse..."); outputBrowse->callback((Fl_Callback *)outputPathCB, this); outputBrowse->tooltip("Choose an output file."); - group = new Fl_Group(140, 100, 325, 20, "Output Format: "); + group = new Fl_Group(180, 110, 325, 20, "Output Format: "); group->align(FL_ALIGN_LEFT); - typeEPUB = new Fl_Round_Button(140, 100, 65, 20, "EPUB"); + typeEPUB = new Fl_Round_Button(180, 110, 65, 20, "EPUB"); typeEPUB->type(FL_RADIO_BUTTON); typeEPUB->callback((Fl_Callback *)outputFormatCB, this); typeEPUB->tooltip("Generate EPUB file(s)."); - typeHTML = new Fl_Round_Button(205, 100, 65, 20, "HTML"); + typeHTML = new Fl_Round_Button(245, 110, 65, 20, "HTML"); typeHTML->type(FL_RADIO_BUTTON); typeHTML->setonly(); typeHTML->callback((Fl_Callback *)outputFormatCB, this); typeHTML->tooltip("Generate HTML file(s)."); - typeHTMLSep = new Fl_Round_Button(270, 100, 95, 20, "Split HTML"); + typeHTMLSep = new Fl_Round_Button(310, 110, 95, 20, "Split HTML"); typeHTMLSep->type(FL_RADIO_BUTTON); typeHTMLSep->callback((Fl_Callback *)outputFormatCB, this); typeHTMLSep->tooltip("Generate separate HTML files for each TOC heading."); - typePS = new Fl_Round_Button(365, 100, 45, 20, "PS"); + typePS = new Fl_Round_Button(405, 110, 45, 20, "PS"); typePS->type(FL_RADIO_BUTTON); typePS->callback((Fl_Callback *)outputFormatCB, this); typePS->tooltip("Generate Adobe PostScript(r) file(s)."); - typePDF = new Fl_Round_Button(410, 100, 55, 20, "PDF"); + typePDF = new Fl_Round_Button(450, 110, 55, 20, "PDF"); typePDF->type(FL_RADIO_BUTTON); typePDF->callback((Fl_Callback *)outputFormatCB, this); typePDF->tooltip("Generate an Adobe Acrobat file."); group->end(); - group = new Fl_Group(140, 125, 265, 20, "Output Options: "); + group = new Fl_Group(180, 140, 265, 20, "Output Options: "); group->align(FL_ALIGN_LEFT); group->end(); - grayscale = new Fl_Check_Button(140, 125, 90, 20, "Grayscale"); + grayscale = new Fl_Check_Button(180, 140, 90, 20, "Grayscale"); grayscale->callback((Fl_Callback *)changeCB, this); grayscale->tooltip("Check to produce grayscale output."); - titlePage = new Fl_Check_Button(230, 125, 90, 20, "Title Page"); + titlePage = new Fl_Check_Button(280, 140, 90, 20, "Title Page"); titlePage->callback((Fl_Callback *)changeCB, this); titlePage->tooltip("Check to generate a title page."); - jpegCompress = new Fl_Check_Button(320, 125, 140, 20, "JPEG Big Images"); + jpegCompress = new Fl_Check_Button(380, 140, 140, 20, "JPEG Big Images"); jpegCompress->callback((Fl_Callback *)jpegCB, this); jpegCompress->tooltip("Check to reduce the size of large images using the JPEG algorithm."); - compGroup = new Fl_Group(140, 150, 345, 40, "Compression: \n "); + compGroup = new Fl_Group(180, 170, 440, 40, "Compression: \n "); compGroup->align(FL_ALIGN_LEFT); - compression = new Fl_Slider(140, 150, 345, 20); + compression = new Fl_Slider(180, 170, 440, 20); compression->type(FL_HOR_NICE_SLIDER); compression->minimum(0.0); compression->maximum(9.0); @@ -421,24 +421,24 @@ compression->callback((Fl_Callback *)changeCB, this); compression->tooltip("Reduce the size of output files."); - label = new Fl_Box(140, 170, 30, 10, "None"); + label = new Fl_Box(180, 190, 30, 10, "None"); label->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); label->labelsize(10); - label = new Fl_Box(170, 170, 30, 10, "Fast"); + label = new Fl_Box(220, 190, 30, 10, "Fast"); label->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); label->labelsize(10); - label = new Fl_Box(455, 170, 30, 10, "Best"); + label = new Fl_Box(590, 190, 30, 10, "Best"); label->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); label->labelsize(10); compGroup->end(); - jpegGroup = new Fl_Group(140, 185, 345, 40, "JPEG Quality: \n "); + jpegGroup = new Fl_Group(180, 210, 440, 40, "JPEG Quality: \n "); jpegGroup->align(FL_ALIGN_LEFT); - jpegQuality = new Fl_Value_Slider(140, 185, 345, 20); + jpegQuality = new Fl_Value_Slider(180, 210, 440, 20); jpegQuality->type(FL_HOR_NICE_SLIDER); jpegQuality->minimum(50.0); jpegQuality->maximum(100.0); @@ -448,11 +448,11 @@ jpegQuality->tooltip("Set the quality of images using JPEG compression.\n" "(lower quality produces smaller output)"); - label = new Fl_Box(175, 205, 40, 10, "Good"); + label = new Fl_Box(215, 230, 40, 10, "Good"); label->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); label->labelsize(10); - label = new Fl_Box(445, 205, 40, 10, "Best"); + label = new Fl_Box(580, 230, 40, 10, "Best"); label->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); label->labelsize(10); @@ -464,94 +464,94 @@ // Page tab... // - pageTab = new Fl_Group(10, 35, 485, 290, "Page"); + pageTab = new Fl_Group(10, 35, 620, 290, "Page"); pageTab->hide(); - pageSize = new Fl_Input(145, 45, 100, 25, "Page Size: "); + pageSize = new Fl_Input(180, 45, 100, 25, "Page Size: "); pageSize->when(FL_WHEN_CHANGED); pageSize->callback((Fl_Callback *)changeCB, this); pageSize->tooltip("Enter the page size."); - pageSizeMenu = new Fl_Menu_Button(245, 45, 25, 25, ""); + pageSizeMenu = new Fl_Menu_Button(280, 45, 25, 25, ""); pageSizeMenu->menu(sizeMenu); pageSizeMenu->callback((Fl_Callback *)sizeCB, this); pageSizeMenu->tooltip("Click to choose a standard size."); - pageDuplex = new Fl_Check_Button(275, 48, 70, 20, "2-Sided"); + pageDuplex = new Fl_Check_Button(310, 45, 70, 20, "2-Sided"); pageDuplex->callback((Fl_Callback *)changeCB, this); pageDuplex->tooltip("Produce output suitable for double-sided printing."); - landscape = new Fl_Check_Button(350, 48, 90, 20, "Landscape"); + landscape = new Fl_Check_Button(385, 45, 90, 20, "Landscape"); landscape->callback((Fl_Callback *)changeCB, this); landscape->tooltip("Check to rotate the output to landscape orientation."); - pageTop = new Fl_Input(230, 75, 60, 25, "Top"); + pageTop = new Fl_Input(265, 75, 60, 25, "Top"); pageTop->when(FL_WHEN_CHANGED); pageTop->callback((Fl_Callback *)changeCB, this); pageTop->tooltip("Enter the top margin."); - pageLeft = new Fl_Input(195, 105, 60, 25, "Left"); + pageLeft = new Fl_Input(230, 105, 60, 25, "Left"); pageLeft->when(FL_WHEN_CHANGED); pageLeft->callback((Fl_Callback *)changeCB, this); pageLeft->tooltip("Enter the left margin."); - pageRight = new Fl_Input(260, 105, 60, 25, "Right"); + pageRight = new Fl_Input(295, 105, 60, 25, "Right"); pageRight->when(FL_WHEN_CHANGED); pageRight->align(FL_ALIGN_RIGHT); pageRight->callback((Fl_Callback *)changeCB, this); pageRight->tooltip("Enter the right margin."); - pageBottom = new Fl_Input(230, 135, 60, 25, "Bottom"); + pageBottom = new Fl_Input(265, 135, 60, 25, "Bottom"); pageBottom->when(FL_WHEN_CHANGED); pageBottom->callback((Fl_Callback *)changeCB, this); pageBottom->tooltip("Enter the bottom margin."); - pageHeaderLeft = new Fl_Choice(145, 165, 110, 25, "Header: "); + pageHeaderLeft = new Fl_Choice(180, 165, 110, 25, "Header: "); pageHeaderLeft->menu(formatMenu); pageHeaderLeft->callback((Fl_Callback *)changeCB, this); pageHeaderLeft->tooltip("Choose the left header."); - pageHeaderCenter = new Fl_Choice(260, 165, 110, 25); + pageHeaderCenter = new Fl_Choice(295, 165, 110, 25); pageHeaderCenter->menu(formatMenu); pageHeaderCenter->callback((Fl_Callback *)changeCB, this); pageHeaderCenter->tooltip("Choose the center header."); - pageHeaderRight = new Fl_Choice(375, 165, 110, 25); + pageHeaderRight = new Fl_Choice(410, 165, 110, 25); pageHeaderRight->menu(formatMenu); pageHeaderRight->callback((Fl_Callback *)changeCB, this); pageHeaderRight->tooltip("Choose the right header."); - pageHeader1Left = new Fl_Choice(145, 195, 110, 25, "Header (1st Page): "); + pageHeader1Left = new Fl_Choice(180, 195, 110, 25, "Header (1st Page): "); pageHeader1Left->menu(formatMenu); pageHeader1Left->callback((Fl_Callback *)changeCB, this); pageHeader1Left->tooltip("Choose the left header1."); - pageHeader1Center = new Fl_Choice(260, 195, 110, 25); + pageHeader1Center = new Fl_Choice(295, 195, 110, 25); pageHeader1Center->menu(formatMenu); pageHeader1Center->callback((Fl_Callback *)changeCB, this); pageHeader1Center->tooltip("Choose the center header1."); - pageHeader1Right = new Fl_Choice(375, 195, 110, 25); + pageHeader1Right = new Fl_Choice(410, 195, 110, 25); pageHeader1Right->menu(formatMenu); pageHeader1Right->callback((Fl_Callback *)changeCB, this); pageHeader1Right->tooltip("Choose the right header1."); - pageFooterLeft = new Fl_Choice(145, 225, 110, 25, "Footer: "); + pageFooterLeft = new Fl_Choice(180, 225, 110, 25, "Footer: "); pageFooterLeft->menu(formatMenu); pageFooterLeft->callback((Fl_Callback *)changeCB, this); pageFooterLeft->tooltip("Choose the left footer."); - pageFooterCenter = new Fl_Choice(260, 225, 110, 25); + pageFooterCenter = new Fl_Choice(295, 225, 110, 25); pageFooterCenter->menu(formatMenu); pageFooterCenter->callback((Fl_Callback *)changeCB, this); pageFooterCenter->tooltip("Choose the center header."); - pageFooterRight = new Fl_Choice(375, 225, 110, 25); + pageFooterRight = new Fl_Choice(410, 225, 110, 25); pageFooterRight->menu(formatMenu); pageFooterRight->callback((Fl_Callback *)changeCB, this); pageFooterRight->tooltip("Choose the right header."); - numberUp = new Fl_Choice(145, 255, 50, 25, "Number Up: "); + numberUp = new Fl_Choice(180, 255, 50, 25, "Number Up: "); numberUp->menu(nupMenu); numberUp->callback((Fl_Callback *)changeCB, this); numberUp->tooltip("Set the number of pages on each sheet."); @@ -562,59 +562,59 @@ // TOC tab... // - tocTab = new Fl_Group(10, 35, 485, 280, "TOC"); + tocTab = new Fl_Group(10, 35, 620, 280, "TOC"); tocTab->hide(); - tocLevels = new Fl_Choice(140, 45, 100, 25, "Table of Contents: "); + tocLevels = new Fl_Choice(180, 45, 100, 25, "Table of Contents: "); tocLevels->menu(tocMenu); tocLevels->callback((Fl_Callback *)tocCB, this); tocLevels->tooltip("Choose the number of table of contents levels."); - numberedToc = new Fl_Check_Button(245, 47, 160, 20, "Numbered Headings"); + numberedToc = new Fl_Check_Button(285, 47, 160, 20, "Numbered Headings"); numberedToc->callback((Fl_Callback *)changeCB, this); numberedToc->tooltip("Check to number all of the headings in the document."); - tocHeader = new Fl_Group(140, 75, 345, 25, "Header: "); + tocHeader = new Fl_Group(180, 75, 345, 25, "Header: "); tocHeader->align(FL_ALIGN_LEFT); - tocHeaderLeft = new Fl_Choice(140, 75, 110, 25); + tocHeaderLeft = new Fl_Choice(180, 75, 110, 25); tocHeaderLeft->menu(formatMenu); tocHeaderLeft->callback((Fl_Callback *)changeCB, this); tocHeaderLeft->tooltip("Choose the left header."); - tocHeaderCenter = new Fl_Choice(255, 75, 110, 25); + tocHeaderCenter = new Fl_Choice(295, 75, 110, 25); tocHeaderCenter->menu(formatMenu); tocHeaderCenter->callback((Fl_Callback *)changeCB, this); tocHeaderCenter->tooltip("Choose the center header."); - tocHeaderRight = new Fl_Choice(370, 75, 110, 25); + tocHeaderRight = new Fl_Choice(410, 75, 110, 25); tocHeaderRight->menu(formatMenu); tocHeaderRight->callback((Fl_Callback *)changeCB, this); tocHeaderRight->tooltip("Choose the right header."); tocHeader->end(); - tocFooter = new Fl_Group(140, 105, 345, 25, "Footer: "); + tocFooter = new Fl_Group(180, 105, 345, 25, "Footer: "); tocFooter->align(FL_ALIGN_LEFT); - tocFooterLeft = new Fl_Choice(140, 105, 110, 25, "Footer: "); + tocFooterLeft = new Fl_Choice(180, 105, 110, 25, "Footer: "); tocFooterLeft->menu(formatMenu); tocFooterLeft->callback((Fl_Callback *)changeCB, this); tocFooterLeft->tooltip("Choose the left footer."); - tocFooterCenter = new Fl_Choice(255, 105, 110, 25); + tocFooterCenter = new Fl_Choice(295, 105, 110, 25); tocFooterCenter->menu(formatMenu); tocFooterCenter->callback((Fl_Callback *)changeCB, this); tocFooterCenter->tooltip("Choose the center footer."); - tocFooterRight = new Fl_Choice(370, 105, 110, 25); + tocFooterRight = new Fl_Choice(410, 105, 110, 25); tocFooterRight->menu(formatMenu); tocFooterRight->callback((Fl_Callback *)changeCB, this); tocFooterRight->tooltip("Choose the right footer."); tocFooter->end(); - tocTitle = new Fl_Input(140, 135, 345, 25, "Title: "); + tocTitle = new Fl_Input(180, 135, 440, 25, "Title: "); tocTitle->when(FL_WHEN_CHANGED); tocTitle->callback((Fl_Callback *)changeCB, this); tocTitle->tooltip("Enter the title of the table of contents."); @@ -625,46 +625,46 @@ // Colors tab... // - colorsTab = new Fl_Group(10, 35, 485, 280, "Colors"); + colorsTab = new Fl_Group(10, 35, 620, 280, "Colors"); colorsTab->hide(); - bodyColor = new Fl_Input(140, 45, 100, 25, "Body Color: "); + bodyColor = new Fl_Input(180, 45, 100, 25, "Body Color: "); bodyColor->when(FL_WHEN_CHANGED); bodyColor->callback((Fl_Callback *)bodyColorCB, this); bodyColor->tooltip("Enter the HTML color for the body (background)."); - bodyLookup = new Fl_Button(240, 45, 80, 25, "Lookup..."); + bodyLookup = new Fl_Button(280, 45, 80, 25, "Lookup..."); bodyLookup->callback((Fl_Callback *)bodyColorCB, this); bodyLookup->tooltip("Click to choose the HTML color for the body (background)."); - bodyImage = new Fl_Input(140, 75, 250, 25, "Body Image: "); + bodyImage = new Fl_Input(180, 75, 340, 25, "Body Image: "); bodyImage->when(FL_WHEN_CHANGED); bodyImage->callback((Fl_Callback *)bodyImageCB, this); bodyImage->tooltip("Enter the image file for the body (background)."); - bodyBrowse = new Fl_Button(390, 75, 95, 25, "Browse..."); + bodyBrowse = new Fl_Button(520, 75, 100, 25, "Browse..."); bodyBrowse->callback((Fl_Callback *)bodyImageCB, this); bodyBrowse->tooltip("Click to choose the image file for the body (background)."); - textColor = new Fl_Input(140, 105, 100, 25, "Text Color: "); + textColor = new Fl_Input(180, 105, 100, 25, "Text Color: "); textColor->when(FL_WHEN_CHANGED); textColor->callback((Fl_Callback *)textColorCB, this); textColor->tooltip("Enter the HTML color for the text."); - textLookup = new Fl_Button(240, 105, 80, 25, "Lookup..."); + textLookup = new Fl_Button(280, 105, 80, 25, "Lookup..."); textLookup->callback((Fl_Callback *)textColorCB, this); textLookup->tooltip("Click to choose the HTML color for the text."); - linkColor = new Fl_Input(140, 135, 100, 25, "Link Color: "); + linkColor = new Fl_Input(180, 135, 100, 25, "Link Color: "); linkColor->when(FL_WHEN_CHANGED); linkColor->callback((Fl_Callback *)linkColorCB, this); linkColor->tooltip("Enter the HTML color for links."); - linkLookup = new Fl_Button(240, 135, 80, 25, "Lookup..."); + linkLookup = new Fl_Button(280, 135, 80, 25, "Lookup..."); linkLookup->callback((Fl_Callback *)linkColorCB, this); linkLookup->tooltip("Click to choose the HTML color for links."); - linkStyle = new Fl_Choice(140, 165, 100, 25, "Link Style: "); + linkStyle = new Fl_Choice(180, 165, 100, 25, "Link Style: "); linkStyle->add("Plain"); linkStyle->add("Underline"); linkStyle->callback((Fl_Callback *)changeCB, this); @@ -676,7 +676,7 @@ // Fonts tab... // - fontsTab = new Fl_Group(10, 35, 485, 290, "Fonts"); + fontsTab = new Fl_Group(10, 35, 620, 290, "Fonts"); fontsTab->hide(); fontBaseSize = new Fl_Counter(200, 45, 150, 25, "Base Font Size: "); @@ -741,35 +741,35 @@ // PostScript tab... // - psTab = new Fl_Group(10, 35, 485, 290, "PS"); + psTab = new Fl_Group(10, 35, 620, 290, "PS"); psTab->hide(); - psLevel = new Fl_Group(140, 45, 310, 20, "PostScript: "); + psLevel = new Fl_Group(180, 45, 310, 20, "PostScript: "); psLevel->align(FL_ALIGN_LEFT); - ps1 = new Fl_Round_Button(140, 45, 70, 20, "Level 1"); + ps1 = new Fl_Round_Button(180, 45, 70, 20, "Level 1"); ps1->type(FL_RADIO_BUTTON); ps1->callback((Fl_Callback *)psCB, this); ps1->tooltip("Produce PostScript Level 1 output."); - ps2 = new Fl_Round_Button(210, 45, 70, 20, "Level 2"); + ps2 = new Fl_Round_Button(250, 45, 70, 20, "Level 2"); ps2->type(FL_RADIO_BUTTON); ps2->callback((Fl_Callback *)psCB, this); ps2->tooltip("Produce PostScript Level 2 output.\n" "(most common)"); - ps3 = new Fl_Round_Button(280, 45, 70, 20, "Level 3"); + ps3 = new Fl_Round_Button(320, 45, 70, 20, "Level 3"); ps3->type(FL_RADIO_BUTTON); ps3->callback((Fl_Callback *)psCB, this); ps3->tooltip("Produce PostScript Level 3 output."); psLevel->end(); - psCommands = new Fl_Check_Button(140, 70, 310, 20, "Send Printer Commands"); + psCommands = new Fl_Check_Button(180, 70, 310, 20, "Send Printer Commands"); psCommands->callback((Fl_Callback *)changeCB, this); psCommands->tooltip("Include PostScript commands to set the media size, etc."); - xrxComments = new Fl_Check_Button(140, 95, 310, 20, "Include Xerox Job Comments"); + xrxComments = new Fl_Check_Button(180, 95, 310, 20, "Include Xerox Job Comments"); xrxComments->callback((Fl_Callback *)changeCB, this); xrxComments->tooltip("Include Xerox job comments to set the media size, etc."); @@ -779,55 +779,55 @@ // PDF tab... // - pdfTab = new Fl_Group(10, 35, 485, 290, "PDF"); + pdfTab = new Fl_Group(10, 35, 620, 290, "PDF"); pdfTab->hide(); - pdfVersion = new Fl_Group(140, 45, 310, 40, "PDF Version: \n "); + pdfVersion = new Fl_Group(180, 45, 440, 40, "PDF Version: \n "); pdfVersion->align(FL_ALIGN_LEFT); - pdf11 = new Fl_Round_Button(140, 45, 125, 20, "1.1 (Acrobat 2.x)"); + pdf11 = new Fl_Round_Button(180, 45, 130, 20, "1.1 (Acrobat 2.x)"); pdf11->type(FL_RADIO_BUTTON); pdf11->callback((Fl_Callback *)pdfCB, this); pdf11->tooltip("Produce PDF files for Acrobat 2.x."); - pdf12 = new Fl_Round_Button(270, 45, 125, 20, "1.2 (Acrobat 3.0)"); + pdf12 = new Fl_Round_Button(320, 45, 130, 20, "1.2 (Acrobat 3.0)"); pdf12->type(FL_RADIO_BUTTON); pdf12->callback((Fl_Callback *)pdfCB, this); pdf12->tooltip("Produce PDF files for Acrobat 3.0."); - pdf13 = new Fl_Round_Button(140, 65, 125, 20, "1.3 (Acrobat 4.0)"); + pdf13 = new Fl_Round_Button(180, 65, 130, 20, "1.3 (Acrobat 4.0)"); pdf13->type(FL_RADIO_BUTTON); pdf13->callback((Fl_Callback *)pdfCB, this); pdf13->tooltip("Produce PDF files for Acrobat 4.0."); - pdf14 = new Fl_Round_Button(270, 65, 125, 20, "1.4 (Acrobat 5.0)"); + pdf14 = new Fl_Round_Button(320, 65, 130, 20, "1.4 (Acrobat 5.0)"); pdf14->type(FL_RADIO_BUTTON); pdf14->callback((Fl_Callback *)pdfCB, this); pdf14->tooltip("Produce PDF files for Acrobat 5.0."); pdfVersion->end(); - pageMode = new Fl_Choice(140, 90, 120, 25, "Page Mode: "); + pageMode = new Fl_Choice(180, 90, 120, 25, "Page Mode: "); pageMode->menu(modeMenu); pageMode->callback((Fl_Callback *)changeCB, this); pageMode->tooltip("Choose the initial viewing mode for the file."); - pageLayout = new Fl_Choice(140, 120, 150, 25, "Page Layout: "); + pageLayout = new Fl_Choice(180, 120, 150, 25, "Page Layout: "); pageLayout->menu(layoutMenu); pageLayout->callback((Fl_Callback *)changeCB, this); pageLayout->tooltip("Choose the initial page layout for the file."); - firstPage = new Fl_Choice(140, 150, 100, 25, "First Page: "); + firstPage = new Fl_Choice(180, 150, 100, 25, "First Page: "); firstPage->menu(firstMenu); firstPage->callback((Fl_Callback *)changeCB, this); firstPage->tooltip("Choose the initial page that will be shown."); - pageEffect = new Fl_Choice(140, 180, 210, 25, "Page Effect: "); + pageEffect = new Fl_Choice(180, 180, 210, 25, "Page Effect: "); pageEffect->menu(effectMenu); pageEffect->callback((Fl_Callback *)effectCB, this); pageEffect->tooltip("Choose the page transition effect."); - pageDuration = new Fl_Value_Slider(140, 210, 345, 20, "Page Duration: "); + pageDuration = new Fl_Value_Slider(180, 210, 440, 20, "Page Duration: "); pageDuration->align(FL_ALIGN_LEFT); pageDuration->type(FL_HOR_NICE_SLIDER); pageDuration->minimum(1.0); @@ -837,7 +837,7 @@ pageDuration->callback((Fl_Callback *)changeCB, this); pageDuration->tooltip("Set the amount of time each page is visible."); - effectDuration = new Fl_Value_Slider(140, 235, 345, 20, "Effect Duration: "); + effectDuration = new Fl_Value_Slider(180, 235, 440, 20, "Effect Duration: "); effectDuration->align(FL_ALIGN_LEFT); effectDuration->type(FL_HOR_NICE_SLIDER); effectDuration->minimum(0.5); @@ -847,10 +847,10 @@ effectDuration->callback((Fl_Callback *)changeCB, this); effectDuration->tooltip("Set the amount of time to use for the page transition effect."); - group = new Fl_Group(140, 260, 350, 25, "Options: "); + group = new Fl_Group(180, 260, 350, 25, "Options: "); group->align(FL_ALIGN_LEFT); - links = new Fl_Check_Button(140, 260, 110, 25, "Include Links"); + links = new Fl_Check_Button(180, 260, 110, 25, "Include Links"); links->callback((Fl_Callback *)changeCB, this); links->tooltip("Check to include hyperlinks in the output file."); @@ -862,19 +862,19 @@ // Security tab... // - securityTab = new Fl_Group(10, 35, 485, 290, "Security"); + securityTab = new Fl_Group(10, 35, 620, 290, "Security"); securityTab->hide(); - encryption = new Fl_Group(140, 45, 310, 20, "Encryption: "); + encryption = new Fl_Group(180, 45, 310, 20, "Encryption: "); encryption->align(FL_ALIGN_LEFT); - encryptionNo = new Fl_Round_Button(140, 45, 40, 20, "No"); + encryptionNo = new Fl_Round_Button(180, 45, 40, 20, "No"); encryptionNo->type(FL_RADIO_BUTTON); encryptionNo->set(); encryptionNo->callback((Fl_Callback *)encryptionCB, this); encryptionNo->tooltip("Select to disable encryption (scrambling) of the output file."); - encryptionYes = new Fl_Round_Button(180, 45, 45, 20, "Yes"); + encryptionYes = new Fl_Round_Button(220, 45, 45, 20, "Yes"); encryptionYes->type(FL_RADIO_BUTTON); encryptionYes->callback((Fl_Callback *)encryptionCB, this); encryptionYes->tooltip("Select to enable encryption (scrambling) of the output file.\n" @@ -882,26 +882,26 @@ encryption->end(); - permissions = new Fl_Group(140, 70, 310, 40, "Permissions: "); + permissions = new Fl_Group(180, 70, 310, 40, "Permissions: "); permissions->align(FL_ALIGN_LEFT); - permPrint = new Fl_Check_Button(140, 70, 80, 20, "Print"); + permPrint = new Fl_Check_Button(180, 70, 80, 20, "Print"); permPrint->tooltip("Check to allow the user to print the output file."); - permModify = new Fl_Check_Button(220, 70, 80, 20, "Modify"); + permModify = new Fl_Check_Button(260, 70, 80, 20, "Modify"); permModify->tooltip("Check to allow the user to modify the output file."); - permCopy = new Fl_Check_Button(140, 90, 80, 20, "Copy"); + permCopy = new Fl_Check_Button(180, 90, 80, 20, "Copy"); permCopy->tooltip("Check to allow the user to copy text and images from the output file."); - permAnnotate = new Fl_Check_Button(220, 90, 80, 20, "Annotate"); + permAnnotate = new Fl_Check_Button(260, 90, 80, 20, "Annotate"); permAnnotate->tooltip("Check to allow the user to annotate the output file."); permissions->end(); - ownerPassword = new Fl_Secret_Input(140, 115, 150, 25, "Owner Password: "); + ownerPassword = new Fl_Secret_Input(180, 115, 150, 25, "Owner Password: "); ownerPassword->maximum_size(32); ownerPassword->tooltip("Enter the password required to modify the file.\n" "(leave blank for a random password)"); - userPassword = new Fl_Secret_Input(140, 145, 150, 25, "User Password: "); + userPassword = new Fl_Secret_Input(180, 145, 150, 25, "User Password: "); userPassword->maximum_size(32); userPassword->tooltip("Enter the password required to open the file.\n" "(leave blank for no password)"); @@ -912,21 +912,21 @@ // Options tab... // - optionsTab = new Fl_Group(10, 35, 485, 290, "Options"); + optionsTab = new Fl_Group(10, 35, 620, 290, "Options"); optionsTab->hide(); - htmlEditor = new Fl_Input(140, 45, 250, 25, "HTML Editor: "); + htmlEditor = new Fl_Input(180, 45, 340, 25, "HTML Editor: "); htmlEditor->value(HTMLEditor); htmlEditor->when(FL_WHEN_CHANGED); htmlEditor->callback((Fl_Callback *)htmlEditorCB, this); htmlEditor->tooltip("Enter the command used to edit HTML files.\n" "(use \"%s\" to insert the filename)"); - htmlBrowse = new Fl_Button(390, 45, 95, 25, "Browse..."); + htmlBrowse = new Fl_Button(520, 45, 100, 25, "Browse..."); htmlBrowse->callback((Fl_Callback *)htmlEditorCB, this); htmlBrowse->tooltip("Click to choose the HTML editor."); - browserWidth = new Fl_Value_Slider(140, 75, 345, 20, "Browser Width: "); + browserWidth = new Fl_Value_Slider(180, 75, 440, 20, "Browser Width: "); browserWidth->align(FL_ALIGN_LEFT); browserWidth->type(FL_HOR_NICE_SLIDER); browserWidth->minimum(300.0); @@ -937,7 +937,7 @@ browserWidth->tooltip("Set the target browser width in pixels.\n" "(this determines the page scaling of images)"); - path = new Fl_Input(140, 100, 345, 25, "Search Path: "); + path = new Fl_Input(180, 100, 440, 25, "Search Path: "); path->value(Path); path->maximum_size(sizeof(Path) - 1); path->when(FL_WHEN_CHANGED); @@ -945,7 +945,7 @@ path->tooltip("Enter one or more directories or URLs to search for files.\n" "(separate each directory or URL with the ';' character)"); - proxy = new Fl_Input(140, 130, 345, 25, "HTTP Proxy URL: "); + proxy = new Fl_Input(180, 130, 440, 25, "HTTP Proxy URL: "); proxy->value(Proxy); proxy->maximum_size(sizeof(Proxy) - 1); proxy->when(FL_WHEN_CHANGED); @@ -953,34 +953,34 @@ proxy->tooltip("Enter a URL for your HTTP proxy server.\n" "(http://server:port)"); - group = new Fl_Group(140, 160, 350, 80, "GUI Options: \n\n\n\n\n"); + group = new Fl_Group(180, 160, 350, 80, "GUI Options: \n\n\n\n\n"); group->align(FL_ALIGN_LEFT); - tooltips = new Fl_Check_Button(140, 160, 75, 20, "Tooltips"); + tooltips = new Fl_Check_Button(180, 160, 75, 20, "Tooltips"); tooltips->callback((Fl_Callback *)tooltipCB, this); tooltips->value(Tooltips); tooltips->tooltip("Check to show tooltips."); - strict_html = new Fl_Check_Button(140, 180, 100, 20, "Strict HTML"); + strict_html = new Fl_Check_Button(180, 180, 100, 20, "Strict HTML"); strict_html->value(StrictHTML); strict_html->tooltip("Check to require strict HTML conformance."); - overflow_errors = new Fl_Check_Button(140, 200, 135, 20, "Error on Overflow"); + overflow_errors = new Fl_Check_Button(180, 200, 135, 20, "Error on Overflow"); overflow_errors->value(OverflowErrors); overflow_errors->tooltip("Check to display an error when the HTML content\n" "is too large to fit on the page."); group->end(); - showAbout = new Fl_Button(75, 290, 130, 25, "About HTMLDOC"); + showAbout = new Fl_Button(140, 290, 150, 25, "About HTMLDOC"); showAbout->callback((Fl_Callback *)showAboutCB); showAbout->tooltip("Click to show information about HTMLDOC."); - showLicense = new Fl_Button(215, 290, 70, 25, "License"); + showLicense = new Fl_Button(300, 290, 90, 25, "License"); showLicense->callback((Fl_Callback *)showLicenseCB); showLicense->tooltip("Click to show the software license."); - saveOptions = new Fl_Button(295, 290, 190, 25, "Save Options and Defaults"); + saveOptions = new Fl_Button(400, 290, 220, 25, "Save Options and Defaults"); saveOptions->callback((Fl_Callback *)saveOptionsCB, this); saveOptions->tooltip("Click to save the current options."); @@ -992,31 +992,31 @@ // Button bar... // - bookHelp = new Fl_Button(10, 335, 55, 25, "Help"); + bookHelp = new Fl_Button(10, 335, 70, 25, "Help"); bookHelp->shortcut(FL_F + 1); bookHelp->callback((Fl_Callback *)helpCB, this); - bookNew = new Fl_Button(70, 335, 50, 25, "New"); + bookNew = new Fl_Button(90, 335, 65, 25, "New"); bookNew->shortcut(FL_CTRL | 'n'); bookNew->callback((Fl_Callback *)newBookCB, this); - bookOpen = new Fl_Button(125, 335, 65, 25, "Open..."); + bookOpen = new Fl_Button(165, 335, 80, 25, "Open..."); bookOpen->shortcut(FL_CTRL | 'o'); bookOpen->callback((Fl_Callback *)openBookCB, this); - bookSave = new Fl_Button(195, 335, 55, 25, "Save"); + bookSave = new Fl_Button(255, 335, 70, 25, "Save"); bookSave->shortcut(FL_CTRL | 's'); bookSave->callback((Fl_Callback *)saveBookCB, this); - bookSaveAs = new Fl_Button(255, 335, 85, 25, "Save As..."); + bookSaveAs = new Fl_Button(335, 335, 105, 25, "Save As..."); bookSaveAs->shortcut(FL_CTRL | FL_SHIFT | 's'); bookSaveAs->callback((Fl_Callback *)saveAsBookCB, this); - bookGenerate = new Fl_Button(345, 335, 85, 25, "Generate"); + bookGenerate = new Fl_Button(450, 335, 100, 25, "Generate"); bookGenerate->shortcut(FL_CTRL | 'g'); bookGenerate->callback((Fl_Callback *)generateBookCB, this); - bookClose = new Fl_Button(435, 335, 60, 25, "Close"); + bookClose = new Fl_Button(560, 335, 70, 25, "Close"); bookClose->shortcut(FL_CTRL | 'q'); bookClose->callback((Fl_Callback *)closeBookCB, this); @@ -1026,7 +1026,7 @@ // Progress bar... // - progressBar = new Fl_Progress(10, 370, 485, 20, "HTMLDOC " SVERSION " Ready."); + progressBar = new Fl_Progress(10, 370, 620, 20, "HTMLDOC " SVERSION " Ready."); window->end(); @@ -4270,7 +4270,7 @@ label->image(&logo); label = new Fl_Box(60, 45, 530, 35, - "HTMLDOC " SVERSION "\nCopyright © 2011-2020 by Michael R Sweet." + "HTMLDOC " SVERSION "\nCopyright © 2011-2022 by Michael R Sweet." ); label->align(FL_ALIGN_TOP_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_WRAP); diff -Nru htmldoc-1.9.15/htmldoc/htmldoc.cxx htmldoc-1.9.16/htmldoc/htmldoc.cxx --- htmldoc-1.9.15/htmldoc/htmldoc.cxx 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/htmldoc/htmldoc.cxx 2022-05-05 13:37:51.000000000 +0000 @@ -1,7 +1,7 @@ /* * Main entry for HTMLDOC, a HTML document processing program. * - * Copyright 2011-2020 by Michael R Sweet. + * Copyright 2011-2022 by Michael R Sweet. * Copyright 1997-2010 by Easy Software Products. All rights reserved. * * This program is free software. Distribution and use rights are outlined in @@ -2607,7 +2607,7 @@ if (CGIMode) puts("Content-Type: text/plain\r\n\r"); - puts("HTMLDOC Version " SVERSION " Copyright 2011-2020 by Michael R Sweet."); + puts("HTMLDOC Version " SVERSION " Copyright 2011-2022 by Michael R Sweet."); puts("HTMLDOC is provided under the terms of the GNU General Public License and"); puts("comes with absolutely no warranty. This software is based in part on the work"); puts("of the Independent JPEG Group."); diff -Nru htmldoc-1.9.15/htmldoc/http.c htmldoc-1.9.16/htmldoc/http.c --- htmldoc-1.9.15/htmldoc/http.c 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/htmldoc/http.c 2022-05-05 13:37:51.000000000 +0000 @@ -1,7 +1,7 @@ /* * HTTP routines for HTMLDOC. * - * Copyright © 2020-2021 by Michael R Sweet + * Copyright © 2020-2022 by Michael R Sweet * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * @@ -2421,6 +2421,7 @@ if (_httpTLSStart(http) != 0) { httpAddrClose(NULL, http->fd); + http->fd = -1; return (-1); } @@ -3555,7 +3556,9 @@ const char *value, /* I - Value string */ int append) /* I - Append value? */ { - char temp[1024]; /* Temporary value string */ + char temp[1024], /* Temporary value string */ + combined[HTTP_MAX_VALUE]; + /* Combined value string */ size_t fieldlen, /* Length of existing value */ valuelen, /* Length of value string */ total; /* Total length of string */ @@ -3630,8 +3633,6 @@ if (total < HTTP_MAX_VALUE && field < HTTP_FIELD_ACCEPT_ENCODING) { - char combined[HTTP_MAX_VALUE]; /* Combined value string */ - /* * Copy short values to legacy char arrays (maintained for binary * compatibility with CUPS 1.2.x and earlier applications...) @@ -3652,21 +3653,21 @@ * Expand the field value... */ - char *combined; /* New value string */ + char *mcombined; /* New value string */ if (http->fields[field] == http->_fields[field]) { - if ((combined = malloc(total + 1)) != NULL) + if ((mcombined = malloc(total + 1)) != NULL) { - http->fields[field] = combined; - snprintf(combined, total + 1, "%s, %s", http->_fields[field], value); + http->fields[field] = mcombined; + snprintf(mcombined, total + 1, "%s, %s", http->_fields[field], value); } } - else if ((combined = realloc(http->fields[field], total + 1)) != NULL) + else if ((mcombined = realloc(http->fields[field], total + 1)) != NULL) { - http->fields[field] = combined; - strlcat(combined, ", ", total + 1); - strlcat(combined, value, total + 1); + http->fields[field] = mcombined; + strlcat(mcombined, ", ", total + 1); + strlcat(mcombined, value, total + 1); } } else @@ -4613,6 +4614,7 @@ * Restore the HTTP request data... */ + httpClearFields(http); memcpy(http->_fields, myhttp._fields, sizeof(http->_fields)); memcpy(http->fields, myhttp.fields, sizeof(http->fields)); diff -Nru htmldoc-1.9.15/htmldoc/image.cxx htmldoc-1.9.16/htmldoc/image.cxx --- htmldoc-1.9.15/htmldoc/image.cxx 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/htmldoc/image.cxx 2022-05-05 13:37:51.000000000 +0000 @@ -27,6 +27,13 @@ /* + * Limits... + */ + +#define IMAGE_MAX_DIM 37837 // Maximum dimension - sqrt(4GiB / 3) + + +/* * GIF definitions... */ @@ -481,7 +488,7 @@ while (code >= clear_code) { - if (sp >= (stack + sizeof(stack))) + if (sp >= (stack + sizeof(stack) / sizeof(stack[0]))) return (255); *sp++ = table[1][code]; @@ -492,7 +499,7 @@ code = table[0][code]; } - if (sp >= (stack + sizeof(stack))) + if (sp >= (stack + sizeof(stack) / sizeof(stack[0]))) return (255); *sp++ = firstcode = table[1][code]; @@ -926,7 +933,7 @@ colors_used = (int)read_dword(fp); read_dword(fp); - if (img->width <= 0 || img->width > 8192 || img->height <= 0 || img->height > 8192 || info_size < 0) + if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM || info_size < 0) return (-1); if (info_size > 40) @@ -1278,7 +1285,7 @@ img->height = (buf[9] << 8) | buf[8]; ncolors = 2 << (buf[10] & 0x07); - if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->height > 32767) + if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) return (-1); // If we are writing an encrypted PDF file, bump the use count so we create @@ -1326,7 +1333,7 @@ img->height = (buf[7] << 8) | buf[6]; img->depth = gray ? 1 : 3; - if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->height > 32767) + if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) return (-1); if (transparent >= 0) @@ -1443,6 +1450,12 @@ img->height = (int)cinfo.output_height; img->depth = (int)cinfo.output_components; + if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) + { + jpeg_destroy_decompress(&cinfo); + return (-1); + } + if (!load_data) { jpeg_destroy_decompress(&cinfo); @@ -1598,6 +1611,12 @@ img->width = (int)png_get_image_width(pp, info); img->height = (int)png_get_image_height(pp, info); + if (img->width <= 0 || img->width > IMAGE_MAX_DIM || img->height <= 0 || img->height > IMAGE_MAX_DIM) + { + png_destroy_read_struct(&pp, &info, NULL); + return (-1); + } + if (color_type & PNG_COLOR_MASK_ALPHA) { if ((PSLevel == 0 && PDFVersion >= 14) || PSLevel == 3) diff -Nru htmldoc-1.9.15/htmldoc/ps-pdf.cxx htmldoc-1.9.16/htmldoc/ps-pdf.cxx --- htmldoc-1.9.15/htmldoc/ps-pdf.cxx 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/htmldoc/ps-pdf.cxx 2022-05-05 13:37:51.000000000 +0000 @@ -537,7 +537,7 @@ if (!source_date_epoch || (doc_time = (time_t)strtol(source_date_epoch, NULL, 10)) <= 0) doc_time = time(NULL); - gmtime_r(&doc_time, &doc_date); + localtime_r(&doc_time, &doc_date); num_headings = 0; alloc_headings = 0; @@ -1706,14 +1706,96 @@ } else if (formatlen == 4 && strncasecmp(formatptr, "TIME", 4) == 0) { + char timefmt[256]; // Time format + formatptr += 4; - strftime(bufptr, sizeof(buffer) - 1 - (size_t)(bufptr - buffer), "%X", &doc_date); + if (*formatptr == '(') + { + // Support "$TIME(format)" + char *timeptr; // Pointer into time format + + for (timeptr = timefmt, formatptr ++; *formatptr && *formatptr != ')'; formatptr ++) + { + if (isalpha(*formatptr)) + { + if (timeptr < (timefmt + sizeof(timefmt) - 2)) + { + *timeptr++ = '%'; + *timeptr++ = *formatptr; + } + else + break; + } + else if (timeptr < (timefmt + sizeof(timefmt) - 1)) + { + *timeptr++ = *formatptr; + } + else + break; + } + + *timeptr = '\0'; + + while (*formatptr && *formatptr != ')') + formatptr ++; + + if (*formatptr) + formatptr ++; + } + else + { + // Use the locale default format... + strlcpy(timefmt, "%X", sizeof(timefmt)); + } + + strftime(bufptr, sizeof(buffer) - 1 - (size_t)(bufptr - buffer), timefmt, &doc_date); bufptr += strlen(bufptr); } else if (formatlen == 4 && strncasecmp(formatptr, "DATE", 4) == 0) { + char datefmt[256]; // Date format + formatptr += 4; - strftime(bufptr, sizeof(buffer) - 1 - (size_t)(bufptr - buffer), "%x", &doc_date); + if (*formatptr == '(') + { + // Support "$DATE(format)" + char *dateptr; // Pointer into date format + + for (dateptr = datefmt, formatptr ++; *formatptr && *formatptr != ')'; formatptr ++) + { + if (isalpha(*formatptr)) + { + if (dateptr < (datefmt + sizeof(datefmt) - 2)) + { + *dateptr++ = '%'; + *dateptr++ = *formatptr; + } + else + break; + } + else if (dateptr < (datefmt + sizeof(datefmt) - 1)) + { + *dateptr++ = *formatptr; + } + else + break; + } + + *dateptr = '\0'; + + while (*formatptr && *formatptr != ')') + formatptr ++; + + if (*formatptr) + formatptr ++; + } + else + { + // Use the locale default format... + strlcpy(datefmt, "%x", sizeof(datefmt)); + } + + strftime(bufptr, sizeof(buffer) - 1 - (size_t)(bufptr - buffer), datefmt, &doc_date); bufptr += strlen(bufptr); } else if (formatlen == 3 && strncasecmp(formatptr, "URL", 3) == 0) @@ -2279,6 +2361,8 @@ if (images[i] == hfimage[hfi]) break; + memset(&temp, 0, sizeof(temp)); // For Coverity, not explicitly necessary + if (images[i]->use > 1 || images[i]->mask || (images[i]->width * images[i]->height * images[i]->depth) > 65536 || images[i] == background_image || @@ -3075,6 +3159,8 @@ if ((link = find_link(htmlGetVariable(temp, (uchar *)"_HD_FILENAME"))) != NULL) { + check_pages(link->page); + x = 0.0f; y = link->top + pages[link->page].bottom; pspdf_transform_coords(pages + link->page, x, y); @@ -3372,6 +3458,7 @@ p = pages + op->pages[i]; for (r = p->start; r != NULL; r = r->next) + { if (r->type == RENDER_LINK) { if ((link = find_link(r->data.link)) != NULL) @@ -3379,40 +3466,43 @@ /* * Local link... */ - float x1, y1, x2, y2; - - lobjs[num_lobjs ++] = pdf_start_object(out); - - fputs("/Subtype/Link", out); + if (link->page < num_pages) + { + float x1, y1, x2, y2; - if (PageDuplex && (op->pages[i] & 1)) - { - x1 = r->x + p->right; - y1 = r->y + p->bottom - 2; - x2 = r->x + r->width + p->right; - y2 = r->y + r->height + p->bottom; - } - else - { - x1 = r->x + p->left; - y1 = r->y + p->bottom - 2; - x2 = r->x + r->width + p->left; - y2 = r->y + r->height + p->bottom; - } + lobjs[num_lobjs ++] = pdf_start_object(out); - pspdf_transform_coords(p, x1, y1); - pspdf_transform_coords(p, x2, y2); - fprintf(out, "/Rect[%.1f %.1f %.1f %.1f]", x1, y1, x2, y2); + fputs("/Subtype/Link", out); - fputs("/Border[0 0 0]", out); + if (PageDuplex && (op->pages[i] & 1)) + { + x1 = r->x + p->right; + y1 = r->y + p->bottom - 2; + x2 = r->x + r->width + p->right; + y2 = r->y + r->height + p->bottom; + } + else + { + x1 = r->x + p->left; + y1 = r->y + p->bottom - 2; + x2 = r->x + r->width + p->left; + y2 = r->y + r->height + p->bottom; + } - x1 = 0.0f; - y1 = link->top + pages[link->page].bottom; - pspdf_transform_coords(pages + link->page, x1, y1); - fprintf(out, "/Dest[%d 0 R/XYZ %.0f %.0f 0]", - pages_object + 2 * pages[link->page].outpage + 1, - x1, y1); - pdf_end_object(out); + pspdf_transform_coords(p, x1, y1); + pspdf_transform_coords(p, x2, y2); + fprintf(out, "/Rect[%.1f %.1f %.1f %.1f]", x1, y1, x2, y2); + + fputs("/Border[0 0 0]", out); + + x1 = 0.0f; + y1 = link->top + pages[link->page].bottom; + pspdf_transform_coords(pages + link->page, x1, y1); + fprintf(out, "/Dest[%d 0 R/XYZ %.0f %.0f 0]", + pages_object + 2 * pages[link->page].outpage + 1, + x1, y1); + pdf_end_object(out); + } } else { @@ -3503,6 +3593,7 @@ pdf_end_object(out); } } + } } if (num_lobjs > 0) @@ -3583,6 +3674,8 @@ pdf_start_object(out); float x, y; + check_pages(link->page); + x = 0.0f; y = link->top + pages[link->page].bottom; pspdf_transform_coords(pages + link->page, x, y); @@ -4870,6 +4963,9 @@ else flat = temp->next; + if (temp->next != NULL) + temp->next->prev = prev; + free(temp); temp = prev; } @@ -4951,6 +5047,9 @@ else flat = temp->next; + if (temp->next != NULL) + temp->next->prev = prev; + free(temp); temp = prev; } @@ -5192,7 +5291,7 @@ case ALIGN_JUSTIFY : linex = image_left; - if (flat != NULL && flat->prev->markup != MARKUP_BR && num_chars > 1) + if (flat != NULL && flat->prev && flat->prev->markup != MARKUP_BR && num_chars > 1) char_spacing = (format_width - width) / (num_chars - 1); break; } @@ -5382,7 +5481,10 @@ prev = temp; temp = temp->next; if (prev != linetype) + { free(prev); + prev = NULL; + } } /* @@ -5405,6 +5507,7 @@ r->y -= height - linetype->height; free(linetype); + linetype = NULL; } /* @@ -6129,6 +6232,7 @@ // Draw background on multiple pages... // Bottom of first page... + check_pages(*page); new_render(*page, RENDER_BOX, table.border_left, bottom, width, row_starty - bottom + table.cellpadding, bgrgb, pages[*page].start); @@ -6136,13 +6240,13 @@ // Intervening pages... for (temp_page = *page + 1; temp_page < row_page; temp_page ++) { + check_pages(temp_page); new_render(temp_page, RENDER_BOX, table.border_left, bottom, width, top - bottom, bgrgb, pages[temp_page].start); } // Top of last page... - check_pages(*page); - + check_pages(row_page); new_render(row_page, RENDER_BOX, table.border_left, row_y, width, top - row_y, bgrgb, pages[row_page].start); @@ -6150,6 +6254,7 @@ else { // Draw background in row... + check_pages(row_page); new_render(row_page, RENDER_BOX, table.border_left, row_y, width, row_height + 2 * table.cellpadding, bgrgb, pages[row_page].start); @@ -6244,9 +6349,12 @@ } if (bgcolor != NULL) + { + check_pages(temp_page); new_render(temp_page, RENDER_BOX, table.border_left, bottom, width + table.border, top - bottom, bgrgb, pages[temp_page].start); + } } if (table.border > 0.0f) @@ -6271,7 +6379,6 @@ if (bgcolor != NULL) { check_pages(table.cell_endpage[col]); - new_render(table.cell_endpage[col], RENDER_BOX, table.border_left, row_y, width + table.border, top - row_y, bgrgb, pages[table.cell_endpage[col]].start); @@ -7176,6 +7283,7 @@ // Draw background on multiple pages... // Bottom of first page... + check_pages(table_page); new_render(table_page, RENDER_BOX, table.border_left, bottom, width, table_y - bottom, bgrgb, pages[table_page].start); @@ -7183,19 +7291,20 @@ // Intervening pages... for (temp_page = table_page + 1; temp_page < *page; temp_page ++) { + check_pages(temp_page); new_render(temp_page, RENDER_BOX, table.border_left, bottom, width, top - bottom, bgrgb, pages[temp_page].start); } // Top of last page... check_pages(*page); - new_render(*page, RENDER_BOX, table.border_left, *y, width, top - *y, bgrgb, pages[*page].start); } else { // Draw background in row... + check_pages(table_page); new_render(table_page, RENDER_BOX, table.border_left, *y, width, table_y - *y, bgrgb, pages[table_page].start); } @@ -11538,9 +11647,14 @@ fprintf(out, "%%%%BoundingBox: 0 0 %d %d\n", PageWidth, PageLength); fprintf(out,"%%%%LanguageLevel: %d\n", PSLevel); fputs("%%Creator: " HTMLDOC_PRODUCER "\n", out); - fprintf(out, "%%%%CreationDate: D:%04d%02d%02d%02d%02d%02d+0000\n", + fprintf(out, "%%%%CreationDate: D:%04d%02d%02d%02d%02d%02d%03d00\n", doc_date.tm_year + 1900, doc_date.tm_mon + 1, doc_date.tm_mday, - doc_date.tm_hour, doc_date.tm_min, doc_date.tm_sec); + doc_date.tm_hour, doc_date.tm_min, doc_date.tm_sec, +#ifdef WIN32 + (int)(_timezone / 3600)); +#else + (int)(doc_date.tm_gmtoff / 3600)); +#endif // WIN32 if (doc_title != NULL) fprintf(out, "%%%%Title: %s\n", doc_title); if (author != NULL) @@ -11922,9 +12036,14 @@ fputs("/Producer", out); write_string(out, (uchar *)HTMLDOC_PRODUCER, 0); fputs("/CreationDate", out); - snprintf(temp, sizeof(temp), "D:%04d%02d%02d%02d%02d%02dZ", + snprintf(temp, sizeof(temp), "D:%04d%02d%02d%02d%02d%02d%03d00", doc_date.tm_year + 1900, doc_date.tm_mon + 1, doc_date.tm_mday, - doc_date.tm_hour, doc_date.tm_min, doc_date.tm_sec); + doc_date.tm_hour, doc_date.tm_min, doc_date.tm_sec, +#ifdef WIN32 + (int)(_timezone / 3600)); +#else + (int)(doc_date.tm_gmtoff / 3600)); +#endif // WIN32 write_string(out, (uchar *)temp, 0); if (doc_title != NULL) diff -Nru htmldoc-1.9.15/htmldoc/tls-gnutls.c htmldoc-1.9.16/htmldoc/tls-gnutls.c --- htmldoc-1.9.15/htmldoc/tls-gnutls.c 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/htmldoc/tls-gnutls.c 2022-05-05 13:37:51.000000000 +0000 @@ -1282,7 +1282,7 @@ int error; /* Error code */ - error = gnutls_bye(http->tls, http->mode == _HTTP_MODE_CLIENT ? GNUTLS_SHUT_RDWR : GNUTLS_SHUT_WR); + error = gnutls_bye(http->tls, GNUTLS_SHUT_WR); if (error != GNUTLS_E_SUCCESS) _cupsSetError(IPP_STATUS_ERROR_INTERNAL, gnutls_strerror(errno), 0); diff -Nru htmldoc-1.9.15/.lgtm.yml htmldoc-1.9.16/.lgtm.yml --- htmldoc-1.9.15/.lgtm.yml 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/.lgtm.yml 2022-05-05 13:37:51.000000000 +0000 @@ -1,5 +1,7 @@ queries: + - exclude: cpp/weak-cryptographic-algorithm + - exclude: cpp/suspicious-add-sizeof + - exclude: cpp/cleartext-storage-file # - exclude: cpp/missing-header-guard # - exclude: cpp/uncontrolled-allocation-size - - exclude: cpp/weak-cryptographic-algorithm # - exclude: cpp/cleartext-storage-file diff -Nru htmldoc-1.9.15/snap/snapcraft.yaml htmldoc-1.9.16/snap/snapcraft.yaml --- htmldoc-1.9.15/snap/snapcraft.yaml 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/snap/snapcraft.yaml 2022-05-05 13:37:51.000000000 +0000 @@ -1,6 +1,6 @@ name: htmldoc base: core20 -version: 1.9.15 +version: 1.9.16 summary: HTML and Markdown conversion utility description: | HTMLDOC is a program that reads HTML and Markdown source files or web pages diff -Nru htmldoc-1.9.15/vcnet/config.h htmldoc-1.9.16/vcnet/config.h --- htmldoc-1.9.15/vcnet/config.h 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/vcnet/config.h 2022-05-05 13:37:51.000000000 +0000 @@ -50,6 +50,7 @@ */ #define gmtime_r(t,tm) gmtime_s(tm,t) +#define localtime_r(t,tm) localtime_s(tm,t) /* @@ -88,7 +89,7 @@ * What is the version number for this software? */ -#define SVERSION "1.9.15" +#define SVERSION "1.9.16" /* diff -Nru htmldoc-1.9.15/vcnet/htmldoc-installer.aip htmldoc-1.9.16/vcnet/htmldoc-installer.aip --- htmldoc-1.9.15/vcnet/htmldoc-installer.aip 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/vcnet/htmldoc-installer.aip 2022-05-05 13:37:51.000000000 +0000 @@ -17,7 +17,7 @@ - + diff -Nru htmldoc-1.9.15/xcode/config.h htmldoc-1.9.16/xcode/config.h --- htmldoc-1.9.15/xcode/config.h 2022-02-05 17:41:09.000000000 +0000 +++ htmldoc-1.9.16/xcode/config.h 2022-05-05 13:37:51.000000000 +0000 @@ -12,7 +12,7 @@ * What is the version number for this software? */ -#define SVERSION "1.9.15" +#define SVERSION "1.9.16" /*