Control: tags -1 confirmed patch
Control: forwarded https://github.com/harmattan/numptyphysics/issues/2

Hello and thanks for your report!


It seems this bug was exposed only recently since I do not remember
seeing it when I prepared the last NMU for numptyphysics. This was also
reported upstream as

https://github.com/harmattan/numptyphysics/issues/2

Fortunately Steven M. Robbins already contributed a patch

https://github.com/harmattan/numptyphysics/pull/3

I have tested this fix and can confirm that it works. A debdiff which
addresses the issue is attached.

Regards,

Markus
diff -Nru numptyphysics-0.2+svn157/debian/changelog 
numptyphysics-0.2+svn157/debian/changelog
--- numptyphysics-0.2+svn157/debian/changelog   2014-03-01 14:13:56.000000000 
+0100
+++ numptyphysics-0.2+svn157/debian/changelog   2014-05-23 12:11:02.000000000 
+0200
@@ -1,3 +1,15 @@
+numptyphysics (0.2+svn157-0.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add double-free-corruption.patch.
+    - Remove valgrind error "Source and destination overlap in
+      memcpy(0xf121b90, 0xf121b98, 944)".
+    - Fix double free or corruption bug. (Closes: #749025)
+    - Thanks to Dima Kogan for the report and Steven M. Robbins
+      for the patch.
+
+ -- Markus Koschany <a...@gambaru.de>  Fri, 23 May 2014 12:07:21 +0200
+
 numptyphysics (0.2+svn157-0.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru numptyphysics-0.2+svn157/debian/patches/double-free-corruption.patch 
numptyphysics-0.2+svn157/debian/patches/double-free-corruption.patch
--- numptyphysics-0.2+svn157/debian/patches/double-free-corruption.patch        
1970-01-01 01:00:00.000000000 +0100
+++ numptyphysics-0.2+svn157/debian/patches/double-free-corruption.patch        
2014-05-23 12:11:02.000000000 +0200
@@ -0,0 +1,27 @@
+From: "Steven M. Robbins" <s...@sumost.ca>
+Date: Sat, 19 Apr 2014 01:43:25 -0500
+Subject: double free corruption
+
+Remove valgrind error "Source and destination overlap in memcpy(0xf121b90, 
0xf121b98, 944)".
+This is the cause of the "double free or corruption" error seen:
+https://github.com/harmattan/numptyphysics/issues/2
+
+Bug: https://bugs.debian.org/749025
+Forwarded: https://github.com/harmattan/numptyphysics/pull/3
+---
+ Array.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Array.h b/Array.h
+index 8acd7d4..d84a39f 100644
+--- a/Array.h
++++ b/Array.h
+@@ -103,7 +103,7 @@ class Array
+     if (i >= 0 ) {
+       ASSERT( i < m_size );
+       if ( i < m_size-1 ) {
+-      memcpy( m_data+i, m_data+i+1, (m_size-i-1)*sizeof(T) );
++      memmove( m_data+i, m_data+i+1, (m_size-i-1)*sizeof(T) );
+       }
+       m_size--;
+     }
diff -Nru numptyphysics-0.2+svn157/debian/patches/series 
numptyphysics-0.2+svn157/debian/patches/series
--- numptyphysics-0.2+svn157/debian/patches/series      2014-02-28 
15:11:01.000000000 +0100
+++ numptyphysics-0.2+svn157/debian/patches/series      2014-05-23 
12:11:02.000000000 +0200
@@ -2,3 +2,4 @@
 fix_icons_installation.patch
 gcc-4.7.patch
 use_fontconfig.patch
+double-free-corruption.patch

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to