[freexl] 03/03: Add patch to fix 32 bit multiplication overflow.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Fri Nov 13 11:39:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch ubuntu/vivid
in repository freexl.

commit fe31f502ee380124b110631212c9179e63e1f474
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Jul 15 22:11:54 2015 +0200

    Add patch to fix 32 bit multiplication overflow.
---
 debian/changelog                                   |  1 +
 debian/patches/32bit-multiplication-overflow.patch | 38 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 40 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index d0d5dc4..526ff70 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 freexl (1.0.0h-1~exp1ubuntu2) UNRELEASED; urgency=medium
 
   * Add patch to fix regression introduced by afl-vulnerabilitities.patch.
+  * Add patch to fix 32 bit multiplication overflow.
 
  -- Bas Couwenberg <sebastic at debian.org>  Thu, 12 Nov 2015 22:04:49 +0100
 
diff --git a/debian/patches/32bit-multiplication-overflow.patch b/debian/patches/32bit-multiplication-overflow.patch
new file mode 100644
index 0000000..f4e1d65
--- /dev/null
+++ b/debian/patches/32bit-multiplication-overflow.patch
@@ -0,0 +1,38 @@
+Description: Fixing a critical bug (32 bit multiplication overflow) reported by RHEL maintainers
+Origin: https://www.gaia-gis.it/fossil/freexl/fdiff?v1=4f9408c216ead322&v2=44802d385bc32499&sbs=1
+Author: Alessandro Furieri <a.furieri at lqt.it>
+
+--- a/src/freexl.c
++++ b/src/freexl.c
+@@ -1066,6 +1066,7 @@ allocate_cells (biff_workbook * workbook
+ /* allocating the rows and cells for the active Worksheet */
+     unsigned int row;
+     unsigned int col;
++    double dsize;
+     biff_cell_value *p_cell;
+ 
+     if (workbook == NULL)
+@@ -1073,6 +1074,14 @@ allocate_cells (biff_workbook * workbook
+     if (workbook->active_sheet == NULL) 
+         return FREEXL_NULL_ARGUMENT;
+ 
++/* testing for an unrealistically high memory size > 256MB */
++    dsize =
++	(double) sizeof (biff_cell_value) *
++	(double) (workbook->active_sheet->rows) *
++	(double) (workbook->active_sheet->columns);
++    if (dsize > 256.0 * 1024.0 * 1024.0)
++	return FREEXL_INSUFFICIENT_MEMORY;
++
+ /* allocating the cell values array */
+     workbook->active_sheet->cell_values =
+ 	malloc (sizeof (biff_cell_value) *
+@@ -1725,6 +1734,8 @@ parse_SST (biff_workbook * workbook, int
+             }
+ 	  workbook->shared_strings.utf8_strings =
+ 	      malloc (sizeof (char **) * workbook->shared_strings.string_count);
++	  if (workbook->shared_strings.utf8_strings == NULL)
++	      return FREEXL_INSUFFICIENT_MEMORY;
+ 	  for (i_string = 0; i_string < workbook->shared_strings.string_count;
+ 	       i_string++)
+ 	      *(workbook->shared_strings.utf8_strings + i_string) = NULL;
diff --git a/debian/patches/series b/debian/patches/series
index b6ce158..dd37952 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 afl-vulnerabilitities.patch
 afl-vulnerabilitities-regression.patch
+32bit-multiplication-overflow.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/freexl.git



More information about the Pkg-grass-devel mailing list