diff options
author | marcus <marcus@FreeBSD.org> | 2003-01-10 02:48:33 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2003-01-10 02:48:33 +0800 |
commit | 70308595530942c5ee624f86d27b253a2219a4bb (patch) | |
tree | aa2df1ab911f69fef6aa7259fb4f44add44098fb | |
parent | 9b57cb208955bb8c395b896412c7fe91869558f2 (diff) | |
download | freebsd-ports-gnome-70308595530942c5ee624f86d27b253a2219a4bb.tar.gz freebsd-ports-gnome-70308595530942c5ee624f86d27b253a2219a4bb.tar.zst freebsd-ports-gnome-70308595530942c5ee624f86d27b253a2219a4bb.zip |
Implement the vendor fix for the recent stack overflow bug. This fix
increases the buffer size ten-fold, but allocates memory dynamically on
the heap.
Obtained from: GNOME CVS
-rw-r--r-- | math/gnumeric/Makefile | 2 | ||||
-rw-r--r-- | math/gnumeric/files/patch-src_xml-io.c | 31 |
2 files changed, 29 insertions, 4 deletions
diff --git a/math/gnumeric/Makefile b/math/gnumeric/Makefile index 5d2b19810a55..a94b0b6530ae 100644 --- a/math/gnumeric/Makefile +++ b/math/gnumeric/Makefile @@ -7,7 +7,7 @@ PORTNAME= gnumeric PORTVERSION= 1.0.12 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES?= math gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/${PORTNAME}/1.0 diff --git a/math/gnumeric/files/patch-src_xml-io.c b/math/gnumeric/files/patch-src_xml-io.c index 8445637e409d..23d57e643117 100644 --- a/math/gnumeric/files/patch-src_xml-io.c +++ b/math/gnumeric/files/patch-src_xml-io.c @@ -1,11 +1,36 @@ ---- src/xml-io.c.orig Mon Jan 6 15:45:21 2003 -+++ src/xml-io.c Mon Jan 6 15:44:40 2003 +--- src/xml-io.c.orig Thu Jan 9 13:44:58 2003 ++++ src/xml-io.c Thu Jan 9 13:46:41 2003 @@ -67,7 +67,7 @@ /* FIXME - tune the values below */ /* libxml1 parser bug breaks multibyte characters on buffer margins */ -#define XML_INPUT_BUFFER_SIZE 1024*1024 -+#define XML_INPUT_BUFFER_SIZE 1024*768 ++#define XML_INPUT_BUFFER_SIZE (10*1024*1024) #define N_ELEMENTS_BETWEEN_UPDATES 20 /* ------------------------------------------------------------------------- */ +@@ -3350,7 +3350,7 @@ + struct stat sbuf; + gint file_size; + ErrorInfo *open_error; +- gchar buffer[XML_INPUT_BUFFER_SIZE]; ++ gchar *buffer; + gint bytes; + xmlParserCtxtPtr pctxt; + xmlDocPtr res; +@@ -3387,6 +3387,7 @@ + io_progress_message (context, _("Reading file...")); + io_progress_range_push (context, 0.0, 0.5); + value_io_progress_set (context, file_size, 0); ++ buffer = g_new (char, XML_INPUT_BUFFER_SIZE); + bytes = gzread (f, buffer, 4); + pctxt = xmlCreatePushParserCtxt (NULL, NULL, buffer, bytes, filename); + +@@ -3395,6 +3396,7 @@ + value_io_progress_update (context, lseek (fd, 0, SEEK_CUR)); + } + xmlParseChunk (pctxt, buffer, 0, 1); ++ g_free (buffer); + + res = pctxt->myDoc; + xmlFreeParserCtxt (pctxt); |