diff --git a/Makefile b/Makefile index 951392a..f9b724e 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ # -CFLAGS=-g -Wall +CFLAGS=-g -O2 -Wall CC=gcc OBJS=convert.o word.o error.o main.o hash.o \ @@ -57,7 +57,7 @@ rm -f ${OBJS} install: ${TARGET} - cp ${TARGET} /usr/local/bin + cp ${TARGET} ${DESTDIR}/usr/bin attr.o: attr.c defs.h error.h attr.h main.h malloc.h convert.o: convert.c attr.h convert.h defs.h error.h hash.h main.h malloc.h \ diff --git a/attr.c b/attr.c index 137b91e..87801d6 100644 --- a/attr.c +++ b/attr.c @@ -53,7 +53,7 @@ extern int simulate_smallcaps; -#define MAX_ATTRS (1000) +#define MAX_ATTRS (10000) diff --git a/convert.c b/convert.c index 7878707..7ffb598 100644 --- a/convert.c +++ b/convert.c @@ -287,7 +287,7 @@ char *name; } FontEntry; -#define MAX_FONTS (256) +#define MAX_FONTS (8192) static FontEntry font_table[MAX_FONTS]; static int total_fonts=0; @@ -327,7 +327,7 @@ CHECK_PARAM_NOT_NULL(w); while(w) { - int num; + int num, name_size; char name[255]; char *tmp; @@ -341,7 +341,7 @@ while(w2) { tmp = word_string (w2); if (tmp && tmp[0] != '\\') - strcat(name,tmp); + strncat(name,tmp,sizeof(name) - strlen(name) - 1); w2=w2->next; } @@ -586,7 +586,7 @@ unsigned char r,g,b; } Color; -#define MAX_COLORS (256) +#define MAX_COLORS (1024) static Color color_table[MAX_COLORS]; static int total_colors=0; diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..b0ba2bb --- /dev/null +++ b/debian/changelog @@ -0,0 +1,126 @@ +unrtf (0.19.3-1.1) unstable; urgency=HIGH + + * NMU + * Fix buffer overflow in process_font_table (CAN-2004-1297) Closes: #287038 + + -- Joey Hess Sat, 25 Dec 2004 20:07:43 -0500 + +unrtf (0.19.3-1) unstable; urgency=low + + * New upstream release + * Closes: #227730: binaries removed + * Closes: #227731: new mime entry + * Closes: #225592: null pointer param in convert.c + + -- Christian Surchi Wed, 2 Jun 2004 19:41:55 +0200 + +unrtf (0.19.0-1) unstable; urgency=low + + * New upstream release + * Let's acknoledge changes from NMUs + * Closes: #195061: FTBFS with gcc-3.3: Uses multiline strings + * Closes: #140824: unrtf segfaults with a particular file + * Closes: #145027: segfault on large rtf file + * Closes: #210930: segfault with + http://www.wizards.com/d20/files/v35/Races.rtf + * Closes: #215102: dumps core on given file + + -- Christian Surchi Sat, 27 Dec 2003 16:58:09 +0100 + +unrtf (0.18.1-2.3) unstable; urgency=low + + * Decreased MAX_ATTRS to 10000, this clears up segfaults that seem to be + because it's too large. Closes: #210930, #215102 + + -- Joey Hess Tue, 28 Oct 2003 16:08:03 -0500 + +unrtf (0.18.1-2.2) unstable; urgency=low + + * NMU + * Increased MAX_FONTS from 256 to 8192 to avoid segfaulting on documents + with many fonts. Of course this should not be a hardcoded limit at all. + Closes: #140824 + * Increased MAX_ATTRS from 1000 to 100000 to avoid segfaulting on other + documents. + Closes: #145027 + * Increased MAX_COLORS from 256 to 1024 on general principles. + + -- Joey Hess Sun, 31 Aug 2003 20:37:50 -0400 + +unrtf (0.18.1-2.1) unstable; urgency=low + + * NMU. Debcamp BSP + * Patched ps.c to fix build problems with GCC 3.3 + Thanks Jakob Hilmer for the patch (Closes: #195061) + + -- Alberto Gonzalez Iniesta Mon, 14 Jul 2003 15:34:21 +0200 + +unrtf (0.18.1-2) unstable; urgency=low + + * Added mime-support (Thanks to Horms) (Closes:#130865,#138852) + + -- Christian Surchi Sun, 24 Mar 2002 17:56:42 +0100 + +unrtf (0.18.1-1) unstable; urgency=low + + * New upstream release, package name changed from rtf2htm to unrtf + (Closes:#128721,#135950) + + -- Christian Surchi Sat, 2 Mar 2002 19:42:00 +0100 + +rtf2htm (0.13.2-1) unstable; urgency=low + + * New upstream release + * New maintainer (Closes: #100258) + + -- Christian Surchi Sun, 10 Jun 2001 16:20:44 +0200 + +rtf2htm (0.13.1-1) unstable; urgency=low + + * New upstream release. + * Deleted DOS and Windows binaries. + * Again removed the original manpage which is still broken, and which is + here again replaced by an updated Debian specific manpage. + + -- Dr. Guenter Bechly Sun, 22 Apr 2001 13:02:59 +0200 + +rtf2htm (0.12.8-1) unstable; urgency=low + + * New upstream release. + * Removed the precompiled windows binary and the broken original manpage + from the sources. + * Fixed Makefile again. + * Merged the content of the (totally broken) original manpage with Debian's + manpage for this utility. + * Corrected control, copyright, docs, and rules file for this new release. + * Removed the obsolete README.Debian file. + * Updated to the latest standards version. + + -- Dr. Guenter Bechly Mon, 9 Apr 2001 19:32:38 +0200 + +rtf2htm (0.12.7-4) unstable; urgency=low + + * Corrected typo in copyright file. + + -- Dr. Guenter Bechly Thu, 29 Mar 2001 13:39:58 +0200 + +rtf2htm (0.12.7-3) unstable; urgency=low + + * Removed useless menu entry; closes: #85889 + + -- Dr. Guenter Bechly Wed, 14 Feb 2001 19:15:48 +0100 + +rtf2htm (0.12.7-2) unstable; urgency=low + + * Just a clean-up of the source package. + + -- Dr. Guenter Bechly Thu, 11 Jan 2001 23:01:49 +0100 + +rtf2htm (0.12.7-1) unstable; urgency=low + + * Initial Release, closes: Bug #80791. + * Adjusted the Makefile to fix $DESTDIR problems. + * Wrote a manpage. + + -- Dr. Guenter Bechly Thu, 28 Dec 2000 20:03:00 +0100 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..7d34647 --- /dev/null +++ b/debian/control @@ -0,0 +1,18 @@ +Source: unrtf +Section: text +Priority: optional +Maintainer: Christian Surchi +Build-Depends: debhelper (>> 3.0.0) +Standards-Version: 3.6.1 + +Package: unrtf +Architecture: any +Depends: ${shlibs:Depends} +Replaces: rtf2htm +Conflicts: rtf2htm +Description: RTF to other formats converter + UnRTF is a moderately complicated converter from RTF to other + formats, including HTML, LaTeX, text, and PostScript. Converting + to HTML, it supports tables, fonts, colors, embedded images, + hyperlinks, paragraph alignment among other things. All other + conversions are "alpha"--just begun. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..899a904 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +This package was debianized by Christian Surchi on +Sat, 2 Mar 2002 19:42:00 +0100. + +rtf2htm was debianized by Dr. Guenter Bechly on +Thu, 28 Dec 2000 20:03:00 +0100. + +The Debian maintainer is Christian Surchi + + +It was downloaded from ftp://ftp.gnu.org/pub/gnu/unrtf/ + +Upstream Author: Dave Davey + Marcos S. Amaral + Zachary Thayer Smith + + +Copyright: (C) 2000,2001 Zachary Thayer Smith + +You are free to distribute this software under the terms of +the GNU General Public Licence. + +On Debian systems, the complete text of the GNU General Public +Licence can be found in /usr/share/common-licenses/GPL file. + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..415f082 --- /dev/null +++ b/debian/dirs @@ -0,0 +1 @@ +/usr/bin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..d6b73a6 --- /dev/null +++ b/debian/docs @@ -0,0 +1,4 @@ +README +TODO +test/ + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..fcf2304 --- /dev/null +++ b/debian/rules @@ -0,0 +1,98 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatibility version to use. +export DH_COMPAT=3 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/unrtf.sgml > unrtf.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/unrtf. + $(MAKE) install DESTDIR=$(CURDIR)/debian/unrtf + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + install -m644 doc/unrtf.html `pwd`/debian/unrtf/usr/share/doc/unrtf +# dh_installexamples +# dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam + dh_installmime +# dh_installinit +# dh_installcron + dh_installman unrtf.1 +# dh_installinfo +# dh_undocumented + dh_installchangelogs CHANGES + dh_link + dh_strip + dh_compress usr/share/doc/unrtf/test/sizes.rtf usr/share/doc/unrtf/test/super.rtf usr/share/doc/unrtf/test/toggle.rtf + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/unrtf.mime b/debian/unrtf.mime new file mode 100644 index 0000000..b559cc5 --- /dev/null +++ b/debian/unrtf.mime @@ -0,0 +1 @@ +application/rtf; unrtf --text %s ; copiousoutput; description=RTF Document; print=unrtf --text %s | print text/plain:- diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..b20f900 --- /dev/null +++ b/debian/watch @@ -0,0 +1,5 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +ftp.gnu.org /pub/gnu/unrtf unrtf-(.*)\.tar\.gz debian uupdate