libpst

changeset 325:cb67b335afcc

patches from debian
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Jan 2013 08:05:08 -0800
parents 6b1399ab2d46
children 1e39dc490627
files AUTHORS Makefile.am configure.in debian/Makefile.am debian/changelog debian/compat debian/control debian/copyright debian/libpst-dev.install debian/libpst1.install debian/patches/05-disable-debian-gen.patch debian/patches/10-current-attach.patch debian/readpst.install debian/rules debian/watch m4/ax_boost_python.m4 regression/regression-tests.bash src/libpst.c src/pst2dii.cpp.in
diffstat 19 files changed, 40 insertions(+), 249 deletions(-) [+]
line diff
     1.1 --- a/AUTHORS	Thu Jan 03 10:09:12 2013 -0800
     1.2 +++ b/AUTHORS	Fri Jan 18 08:05:08 2013 -0800
     1.3 @@ -34,6 +34,7 @@
     1.4      Hugo DesRosiers <info@akralogic.com>
     1.5      Kenneth Berland <ken@hero.com>
     1.6      Leo 'costela' Antunes <costela@debian.org>
     1.7 +    Svante Signell <svante.signell@telia.com>
     1.8  
     1.9  Testing team:
    1.10      Mac OSX - Michael Watson <mike@mikeandgayle.com>
     2.1 --- a/Makefile.am	Thu Jan 03 10:09:12 2013 -0800
     2.2 +++ b/Makefile.am	Fri Jan 18 08:05:08 2013 -0800
     2.3 @@ -1,6 +1,6 @@
     2.4  ACLOCAL_AMFLAGS = -I m4
     2.5  
     2.6 -SUBDIRS = src python man html debian
     2.7 +SUBDIRS = src python man html
     2.8  htmldir = ${datadir}/doc/@PACKAGE@-@VERSION@
     2.9  html_DATA = AUTHORS COPYING ChangeLog NEWS README
    2.10  CLEANFILES = xml/libpst xml/Makefile
     3.1 --- a/configure.in	Thu Jan 03 10:09:12 2013 -0800
     3.2 +++ b/configure.in	Fri Jan 18 08:05:08 2013 -0800
     3.3 @@ -189,7 +189,7 @@
     3.4  fi
     3.5  AC_FUNC_STRFTIME
     3.6  AC_FUNC_VPRINTF
     3.7 -AC_CHECK_FUNCS([chdir getcwd memchr memmove memset regcomp strcasecmp strncasecmp strchr strdup strerror strpbrk strrchr strstr strtol])
     3.8 +AC_CHECK_FUNCS([chdir getcwd memchr memmove memset regcomp strcasecmp strncasecmp strchr strdup strerror strpbrk strrchr strstr strtol get_current_dir_name])
     3.9  AM_ICONV
    3.10  if test "$am_cv_func_iconv" != "yes"; then
    3.11      AC_MSG_ERROR([libpst requires iconv which is missing])
    3.12 @@ -365,7 +365,6 @@
    3.13  
    3.14  AC_OUTPUT(                  \
    3.15      Makefile                \
    3.16 -    debian/Makefile         \
    3.17      html/Makefile           \
    3.18      libpst.pc               \
    3.19      libpst.spec             \
     4.1 --- a/debian/Makefile.am	Thu Jan 03 10:09:12 2013 -0800
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,12 +0,0 @@
     4.4 -EXTRA_DIST =                        \
     4.5 -    changelog                       \
     4.6 -    compat                          \
     4.7 -    control                         \
     4.8 -    copyright                       \
     4.9 -    libpst1.install                 \
    4.10 -    libpst-dev.install              \
    4.11 -    Makefile.am                     \
    4.12 -    patches/10-current-attach.patch \
    4.13 -    readpst.install                 \
    4.14 -    rules                           \
    4.15 -    watch
     5.1 --- a/debian/changelog	Thu Jan 03 10:09:12 2013 -0800
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,24 +0,0 @@
     5.4 -libpst (0.6.27-0ubuntu1) jaunty; urgency=low
     5.5 -
     5.6 -  [ HggdH ]
     5.7 -  * new upstream source being used  (LP: #317602) -- www.five-ten-sg.com/libpst:
     5.8 -    Debian's libpst version does not provide a shared library, and
     5.9 -    does not support newer Evolution PST files; dropping it.
    5.10 -  * remove upstream basic debianisation, and re-debianise using CDBS.
    5.11 -    upstream provides a basic, incomplete, and non-functional ./debian;
    5.12 -    also, add a ./debian/rules get-orig-source target in order to 
    5.13 -    cleanup nicely.
    5.14 -  * debian/patches/10-current-attach.patch: patch for Evolution use,
    5.15 -      should be eventually dropped for a Evolution patch upstream.
    5.16 -  * debian/patches/05-disable-debian-gen.patch: adjust configure.in
    5.17 -    and Makefile.am not to generate the debian directory and files.
    5.18 -  * changed dependency from libgd2-noxpm to libgd2-xpm >= 2.0.36
    5.19 -      (current jaunty alpha 3 level).
    5.20 -  * add a Conflitcs for readpst < 0.6.27, to guarantee upgrade for
    5.21 -    those using the old libpst packages.
    5.22 -
    5.23 -  [ Iain Lane ]
    5.24 -  * Set priority: extra and remove conflicts on same binary package
    5.25 -  * debian/copyright: Update and mention GPL-2+ licensed file src/lzfu.c 
    5.26 -
    5.27 - -- HggdH <hggdh2@gmail.com>  Wed, 25 Feb 2009 10:49:13 -0600
     6.1 --- a/debian/compat	Thu Jan 03 10:09:12 2013 -0800
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,1 +0,0 @@
     6.4 -5
     7.1 --- a/debian/control	Thu Jan 03 10:09:12 2013 -0800
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,49 +0,0 @@
     7.4 -Source: libpst
     7.5 -Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
     7.6 -XSBC-Original-Maintainer: Carl Byington <carl@five-ten-sg.com>
     7.7 -Section: utils
     7.8 -Priority: optional
     7.9 -Build-Depends: debhelper (>= 5),
    7.10 -		cdbs,
    7.11 -		libtool,
    7.12 -		autotools-dev,
    7.13 -		libfreetype6-dev,
    7.14 -		libgd2-xpm-dev,
    7.15 -		zlib1g-dev,
    7.16 -		libjpeg62-dev
    7.17 -Standards-Version: 3.8.0
    7.18 -
    7.19 -Package: readpst
    7.20 -Priority: optional
    7.21 -Architecture: any
    7.22 -Depends: ${shlibs:Depends},
    7.23 -	${misc:Depends},
    7.24 -	libpst1 (= ${binary:Version}),
    7.25 -	imagemagick
    7.26 -Description: Utilities to convert Outlook .pst files to other formats
    7.27 - The readpst utilities include readpst which can convert email messages
    7.28 - to both mbox and MH mailbox formats, pst2ldif which can convert the
    7.29 - contacts to .ldif format for import into ldap databases, and pst2dii
    7.30 - which can convert email messages to the DII load file format used by
    7.31 - Summation. Requires the shared libray provided by libpst1.
    7.32 -
    7.33 -Package: libpst1
    7.34 -Architecture: any
    7.35 -Priority: optional
    7.36 -Section: libs
    7.37 -Depends: ${shlibs:Depends},
    7.38 -	${misc:Depends}
    7.39 -Description: Shared library needed by the readpst utilities, and
    7.40 - other programmes. The libpst shared library is required by the
    7.41 - readpst utilities, and provides the necessary functions to manipulate
    7.42 - the Outlook PST files.
    7.43 -
    7.44 -Package: libpst-dev
    7.45 -Architecture: any
    7.46 -Priority: optional
    7.47 -Section: libdevel
    7.48 -Depends: libpst1 (= ${binary:Version}),
    7.49 -	${misc:Depends}
    7.50 -Description: development files needed for libpst1.
    7.51 - Development files needed if coding or compiling programmes that use
    7.52 - the libpst shared libray.
     8.1 --- a/debian/copyright	Thu Jan 03 10:09:12 2013 -0800
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,64 +0,0 @@
     8.4 -This package was debianized by Joachim Metz <forensics@hoffmannbv.nl> on
     8.5 -Thu, 29 May 2008 15:37:06 +0200.
     8.6 -
     8.7 -It was downloaded from http://www.five-ten-sg.com/libpst.
     8.8 -
     8.9 -Upstream maintainter: Carl Byington <carl@five-ten-sg.com>
    8.10 -
    8.11 -Copyright:
    8.12 -
    8.13 -Original version by:
    8.14 -    Dave Smith <dave.s@earthcorp.com>
    8.15 -    Dave Smith <davesmith@users.sourceforge.net>
    8.16 -
    8.17 -Current maintainer:
    8.18 -    Carl Byington <carl@five-ten-sg.com>
    8.19 -
    8.20 -With contributions by:
    8.21 -    Joseph Nahmias <joe@nahmias.net>
    8.22 -    Arne Ahrend <aahrend@web.de>
    8.23 -    Nigel Horne <njh@bandsman.co.uk>
    8.24 -    Chris Halls <halls@debian.org>
    8.25 -    Stevens Miller <smiller@novadatalabs.com>
    8.26 -    Brad Hards <bradh@frogmouth.net>
    8.27 -    Alexander Grau <alexandergrau@gmx.de>
    8.28 -    Antonio Palama <palama@inwind.it>
    8.29 -    Sean Loaring <sloaring@tec-man.com>
    8.30 -    James Woodcock
    8.31 -
    8.32 -License:
    8.33 -
    8.34 -    This package is free software; you can redistribute it and/or modify
    8.35 -    it under the terms of the GNU General Public License as published by
    8.36 -    the Free Software Foundation; version 2 dated June, 1991.
    8.37 -
    8.38 -    This package is distributed in the hope that it will be useful,
    8.39 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.40 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    8.41 -    GNU General Public License for more details.
    8.42 -
    8.43 -    You should have received a copy of the GNU General Public License
    8.44 -    along with this package; if not, write to the Free Software
    8.45 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
    8.46 -
    8.47 -The file src/lzfu.c is licensed under the GPL-2+.
    8.48 -
    8.49 -License:
    8.50 -
    8.51 -    This package is free software; you can redistribute it and/or modify
    8.52 -    it under the terms of the GNU General Public License as published by
    8.53 -    the Free Software Foundation; either version 2 of the License, or
    8.54 -	(at your option) any later version.
    8.55 - 
    8.56 -    This package is distributed in the hope that it will be useful,
    8.57 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.58 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    8.59 -    GNU General Public License for more details.
    8.60 - 
    8.61 -    You should have received a copy of the GNU General Public License
    8.62 -    along with this package; if not, write to the Free Software
    8.63 -    Foundation, Inc., 51 Franklin St, Fifth Floor,
    8.64 -    Boston, MA 02110-1301, USA.
    8.65 -
    8.66 -The Debian packaging is (C) 2008, Joachim Metz <forensics@hoffmannbv.nl> and
    8.67 -is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'.
     9.1 --- a/debian/libpst-dev.install	Thu Jan 03 10:09:12 2013 -0800
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,3 +0,0 @@
     9.4 -debian/tmp/usr/include/libpst*
     9.5 -debian/tmp/usr/lib/libpst*.so
     9.6 -debian/tmp/usr/lib/pkgconfig/*
    10.1 --- a/debian/libpst1.install	Thu Jan 03 10:09:12 2013 -0800
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,1 +0,0 @@
    10.4 -debian/tmp/usr/lib/libpst*.so.*
    11.1 --- a/debian/patches/05-disable-debian-gen.patch	Thu Jan 03 10:09:12 2013 -0800
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,19 +0,0 @@
    11.4 ---- libpst-0.6.27-orig/configure.in	2009-02-07 12:21:50.000000000 -0600
    11.5 -+++ libpst-0.6.27/configure.in	2009-02-24 16:19:03.000000000 -0600
    11.6 -@@ -261,8 +261,6 @@
    11.7 - 
    11.8 - AC_OUTPUT(                  \
    11.9 -     Makefile                \
   11.10 --    debian/Makefile         \
   11.11 --    debian/changelog        \
   11.12 -     html/Makefile           \
   11.13 -     info/Makefile           \
   11.14 -     libpst.pc               \
   11.15 ---- libpst-0.6.27-orig/Makefile.am	2009-02-07 12:21:50.000000000 -0600
   11.16 -+++ libpst-0.6.27/Makefile.am	2009-02-24 18:12:02.000000000 -0600
   11.17 -@@ -1,4 +1,4 @@
   11.18 --SUBDIRS = src man html info debian
   11.19 -+SUBDIRS = src man html info
   11.20 - htmldir = ${datadir}/doc/@PACKAGE@-@VERSION@
   11.21 - html_DATA = AUTHORS COPYING ChangeLog NEWS README
   11.22 - CLEANFILES = xml/libpst xml/Makefile
    12.1 --- a/debian/patches/10-current-attach.patch	Thu Jan 03 10:09:12 2013 -0800
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,11 +0,0 @@
    12.4 -diff -Nur libpst-0.6.24-orig/src/libpst.h libpst-0.6.24/src/libpst.h
    12.5 ---- libpst-0.6.24-orig/src/libpst.h	2009-01-15 13:43:38.000000000 -0600
    12.6 -+++ libpst-0.6.24/src/libpst.h	2009-01-15 15:29:51.000000000 -0600
    12.7 -@@ -449,6 +449,7 @@
    12.8 -     struct pst_item_folder        *folder;          // data reffering to folder
    12.9 -     struct pst_item_contact       *contact;         // data reffering to contact
   12.10 -     struct pst_item_attach        *attach;          // linked list of attachments
   12.11 -+    struct pst_item_attach	  *current_attach;  // linked list of current attachments
   12.12 -     struct pst_item_message_store *message_store;   // data referring to the message store
   12.13 -     struct pst_item_extra_field   *extra_fields;    // linked list of extra headers and such
   12.14 -     struct pst_item_journal       *journal;         // data reffering to a journal entry
    13.1 --- a/debian/readpst.install	Thu Jan 03 10:09:12 2013 -0800
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,4 +0,0 @@
    13.4 -debian/tmp/usr/bin/*
    13.5 -debian/tmp/usr/share/man/man1/*
    13.6 -debian/tmp/usr/share/man/man5/*
    13.7 -debian/tmp/usr/share/doc/*
    14.1 --- a/debian/rules	Thu Jan 03 10:09:12 2013 -0800
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,42 +0,0 @@
    14.4 -#!/usr/bin/make -f
    14.5 -include /usr/share/cdbs/1/rules/debhelper.mk 
    14.6 -include /usr/share/cdbs/1/class/autotools.mk 
    14.7 -include /usr/share/cdbs/1/rules/simple-patchsys.mk 
    14.8 -
    14.9 -export DH_VERBOSE=1
   14.10 -DEB_CONFIGURE_EXTRA_FLAGS = --enable-libpst-shared
   14.11 -DEB_AUTO_UPDATE_AUTOCONF = 2.63
   14.12 -DEB_AUTO_UPDATE_AUTOMAKE = 1.10
   14.13 -DEB_AUTO_UPDATE_LIBTOOL = pre
   14.14 -
   14.15 -# Makefile arcanery warning:
   14.16 -# $(dir $(_)) gives us the path containing this rules file.  
   14.17 -# I haven't found this documented in any make documentation, so I am unsure 
   14.18 -# how portable/version independent it is.
   14.19 -# This magic care of Emmet Hickory:
   14.20 -# (http://lists.debian.org/debian-devel-games/2008/02/msg00135.html)
   14.21 -
   14.22 -TEMP_DIR := $(shell mktemp -d)
   14.23 -SOURCE_DIR = $(word 1, $(shell ls -d --group-directories-first $(TEMP_DIR)/*))
   14.24 -SOURCE_VER = $(shell echo $(notdir $(SOURCE_DIR)) | sed s/libpst-//)
   14.25 -CURVER = $(shell dpkg-parsechangelog | grep ^Version | cut -d" " -f2 | cut -d"-" -f1 | cut -d"+" -f1 )
   14.26 -
   14.27 -download-tarball:
   14.28 -		uscan --download --destdir $(TEMP_DIR) \
   14.29 -			--no-symlink --force-download --download-version $(CURVER) \
   14.30 -			--watchfile=$(dir $(_))/watch
   14.31 -	 	cd $(TEMP_DIR) && tar xzvf *.tar.gz
   14.32 -
   14.33 -delete-shipped-debian: download-tarball
   14.34 -		rm -r $(TEMP_DIR)/libpst-$(CURVER)/debian
   14.35 -repack-source: delete-shipped-debian
   14.36 -	 	cd $(TEMP_DIR) && \
   14.37 -		tar czvf libpst_$(SOURCE_VER).orig.tar.gz \
   14.38 -			libpst-$(CURVER)
   14.39 -
   14.40 -get-orig-source: repack-source
   14.41 -		mv $(TEMP_DIR)/libpst_$(CURVER).orig.tar.gz ..
   14.42 -		rm -r $(TEMP_DIR)
   14.43 -
   14.44 -.PHONY: download-tarball delete-shipped-debian repack-source get-orig-source
   14.45 -
    15.1 --- a/debian/watch	Thu Jan 03 10:09:12 2013 -0800
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,3 +0,0 @@
    15.4 -version=3
    15.5 -
    15.6 -http://www.five-ten-sg.com/libpst/packages/ libpst-(.*)\.tar\.gz
    16.1 --- a/m4/ax_boost_python.m4	Thu Jan 03 10:09:12 2013 -0800
    16.2 +++ b/m4/ax_boost_python.m4	Fri Jan 18 08:05:08 2013 -0800
    16.3 @@ -63,7 +63,7 @@
    16.4   AC_LANG_CPLUSPLUS
    16.5   CPPFLAGS_SAVE=$CPPFLAGS
    16.6   if test x$PYTHON_INCLUDE_DIR != x; then
    16.7 -   CPPFLAGS=-I$PYTHON_INCLUDE_DIR $CPPFLAGS
    16.8 +   CPPFLAGS="-I$PYTHON_INCLUDE_DIR $CPPFLAGS"
    16.9   fi
   16.10   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
   16.11   #include <boost/python/module.hpp>
    17.1 --- a/regression/regression-tests.bash	Thu Jan 03 10:09:12 2013 -0800
    17.2 +++ b/regression/regression-tests.bash	Fri Jan 18 08:05:08 2013 -0800
    17.3 @@ -129,10 +129,10 @@
    17.4  #$func  22 rendgen4.pst          # appointment test cases
    17.5  #$func  23 rendgen5.pst          # appointment test cases
    17.6  $func  24 paul.sheer.pst        # embedded rfc822 attachment
    17.7 -#$func  25 jerry.pst             # non ascii subject lines
    17.8 +$func  25 jerry.pst             # non ascii subject lines
    17.9  #$func  26 phill.bertolus.pst    # possible segfault in forked process, cannot reproduce
   17.10 -#$func  27 kaiser.pst            # appointments with other character sets
   17.11 -#$func  28 pstsample.pst         # character set issue
   17.12 +$func  27 kaiser.pst            # appointments with other character sets
   17.13 +$func  28 pstsample.pst         # character set issue
   17.14  #$func  29 pstsample2.pst        # embedded image in rtf data
   17.15  $func  30 pstsample3.pst        # exports of rtf and html
   17.16  
    18.1 --- a/src/libpst.c	Thu Jan 03 10:09:12 2013 -0800
    18.2 +++ b/src/libpst.c	Fri Jan 18 08:05:08 2013 -0800
    18.3 @@ -289,6 +289,17 @@
    18.4  static char*            pst_wide_to_single(char *wt, size_t size);
    18.5  
    18.6  
    18.7 +static char *pst_getcwd(void) {
    18.8 +    char *cwd;
    18.9 +#ifdef HAVE_GET_CURRENT_DIR_NAME
   18.10 +    cwd = get_current_dir_name();
   18.11 +#else
   18.12 +    cwd = pst_malloc(PATH_MAX+1);
   18.13 +    getcwd(cwd, PATH_MAX+1);
   18.14 +#endif
   18.15 +    return cwd;
   18.16 +}
   18.17 +
   18.18  
   18.19  int pst_open(pst_file *pf, const char *name, const char *charset) {
   18.20      int32_t sig;
   18.21 @@ -361,20 +372,24 @@
   18.22  
   18.23      DEBUG_RET();
   18.24  
   18.25 -    pf->cwd = pst_malloc(PATH_MAX+1);
   18.26 -    getcwd(pf->cwd, PATH_MAX+1);
   18.27 +    pf->cwd   = pst_getcwd();
   18.28      pf->fname = strdup(name);
   18.29      return 0;
   18.30  }
   18.31  
   18.32  
   18.33  int  pst_reopen(pst_file *pf) {
   18.34 -    char cwd[PATH_MAX];
   18.35 -    if (!getcwd(cwd, PATH_MAX))            return -1;
   18.36 -    if (chdir(pf->cwd))                    return -1;
   18.37 -    if (!freopen(pf->fname, "rb", pf->fp)) return -1;
   18.38 -    if (chdir(cwd))                        return -1;
   18.39 +    char *cwd;
   18.40 +    cwd = pst_getcwd();
   18.41 +    if (cwd == NULL)                       return -1;
   18.42 +    if (chdir(pf->cwd))                    goto err;
   18.43 +    if (!freopen(pf->fname, "rb", pf->fp)) goto err;
   18.44 +    if (chdir(cwd))                        goto err;
   18.45 +    free(cwd);
   18.46      return 0;
   18.47 +err:
   18.48 +    free(cwd);
   18.49 +    return -1;
   18.50  }
   18.51  
   18.52  
    19.1 --- a/src/pst2dii.cpp.in	Thu Jan 03 10:09:12 2013 -0800
    19.2 +++ b/src/pst2dii.cpp.in	Fri Jan 18 08:05:08 2013 -0800
    19.3 @@ -42,7 +42,7 @@
    19.4  char*    font_file = NULL;
    19.5  int      bates_color = 0xff0000;    // color of bates header stamp
    19.6  int      email_sequence = 0;        // current pdf sequence number
    19.7 -char     pdf_name[PATH_MAX];        // current pdf file name
    19.8 +char*    pdf_name = NULL;           // current pdf file name
    19.9  FILE*    dii_file = NULL;           // the output dii load file
   19.10  pst_file pstfile;                   // the input pst file
   19.11  
   19.12 @@ -344,8 +344,9 @@
   19.13  {
   19.14      if (png_open) {
   19.15          png_open = false;
   19.16 -        char fn[PATH_MAX];
   19.17 -        snprintf(fn, sizeof(fn), "page%d.png", ++page_sequence);
   19.18 +        int len = 4 + 11 + 4 +1;
   19.19 +        char *fn = (char*)pst_malloc(len);
   19.20 +        snprintf(fn, len, "page%d.png", ++page_sequence);
   19.21          FILE *pngout = fopen(fn, "wb");
   19.22          if (pngout) {
   19.23              gdImagePng(image, pngout);
   19.24 @@ -354,6 +355,7 @@
   19.25          gdImageDestroy(image); // free memory
   19.26          png_names.push_back(fn);
   19.27          conversion += string(" ") + fn;
   19.28 +        free(fn);
   19.29      }
   19.30  }
   19.31  
   19.32 @@ -366,9 +368,12 @@
   19.33      conversion    = string(convert);
   19.34      png_names.clear();
   19.35      open_png();
   19.36 -    snprintf(pdf_name, sizeof(pdf_name), "dii%06d", ++email_sequence);
   19.37 +    /* Note; allocating the largest string length to pdf_name */
   19.38 +    int len = strlen(output_directory) + 4 + 6 + 4 + 1;
   19.39 +    pdf_name = (char*)pst_malloc(len);
   19.40 +    snprintf(pdf_name, 3 + 6 + 1, "dii%06d", ++email_sequence);
   19.41      fprintf(dii_file, "\n@T %s\n", pdf_name);
   19.42 -    snprintf(pdf_name, sizeof(pdf_name), "%s/dii%06d.pdf", output_directory, email_sequence);
   19.43 +    snprintf(pdf_name, len, "%s/dii%06d.pdf", output_directory, email_sequence);
   19.44  }
   19.45  
   19.46  
   19.47 @@ -382,6 +387,7 @@
   19.48          remove((*i).c_str());
   19.49      }
   19.50      fprintf(dii_file, "@D %s\n", pdf_name);
   19.51 +    free(pdf_name);
   19.52  }
   19.53  
   19.54