[med-svn] [bwa] 01/01: fix issues found within investigation of upstream issue #108
Nadiya Sitdykova
rovenskasa-guest at moszumanska.debian.org
Fri Jun 30 21:43:07 UTC 2017
This is an automated email from the git hooks/post-receive script.
rovenskasa-guest pushed a commit to branch master
in repository bwa.
commit 521729be5aef886451145b8fbd0e30c57a5eb184
Author: Nadiya Sitdykova <rovenskasa at gmail.com>
Date: Fri Jun 30 17:42:56 2017 -0400
fix issues found within investigation of upstream issue #108
---
debian/changelog | 11 +++++++++++
debian/patches/fix_heap_block_overrun | 18 ++++++++++++++++++
debian/patches/fix_wrong_type_casting | 20 ++++++++++++++++++++
debian/patches/series | 2 ++
4 files changed, 51 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 8e932f8..d74824c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+bwa (0.7.15-5) UNRELEASED; urgency=medium
+
+ * Team upload.
+
+ [Nadiya Sitdykova]
+ * Add patch to fix heap block overrun
+ * Add patch with workaround for incorrect implicit type casting
+ (resolves upstream issue #108)
+
+ -- Nadiya Sitdykova <rovenskasa at gmail.com> Fri, 30 Jun 2017 17:37:35 -0400
+
bwa (0.7.15-4) UNRELEASED; urgency=medium
* Debugging (see deactivated patch debian/patches/debug.patch that tries
diff --git a/debian/patches/fix_heap_block_overrun b/debian/patches/fix_heap_block_overrun
new file mode 100644
index 0000000..b572574
--- /dev/null
+++ b/debian/patches/fix_heap_block_overrun
@@ -0,0 +1,18 @@
+Author: Nadiya Sitdykova
+Description: allocate more memory so the heap block overrun wouldn't
+happen (when qlen = 0). Issue was spotted by valgrind during
+investigation of bug https://github.com/lh3/bwa/issues/108
+Last-Update: 2017-06-30
+
+======================================================================
+--- bwa.orig/ksw.c
++++ bwa/ksw.c
+@@ -385,7 +385,7 @@
+ assert(h0 > 0);
+ // allocate memory
+ qp = malloc(qlen * m);
+- eh = calloc(qlen + 1, 8);
++ eh = calloc(qlen + 2, 8);
+ // generate the query profile
+ for (k = i = 0; k < m; ++k) {
+ const int8_t *p = &mat[k * m];
diff --git a/debian/patches/fix_wrong_type_casting b/debian/patches/fix_wrong_type_casting
new file mode 100644
index 0000000..d74baf8
--- /dev/null
+++ b/debian/patches/fix_wrong_type_casting
@@ -0,0 +1,20 @@
+Author: Nadiya Sitdykova
+Description: a workaround for incorrect implicit type casting.
+The comparison end - beg < l_mseq incorrectly returned False
+when end = 0, beg = 1, l_mseq = 149. Which led to further call
+of malloc with negative argument.
+Last-Update: 2017-06-30
+Bug: https://github.com/lh3/bwa/issues/108
+
+=================================================================
+--- bwa.orig/bwtsw2_pair.c
++++ bwa/bwtsw2_pair.c
+@@ -117,7 +117,7 @@
+ }
+ if (beg < 1) beg = 1;
+ if (end > l_pac) end = l_pac;
+- if (end - beg < l_mseq) return;
++ if (end < beg || end - beg < l_mseq) return;
+ // generate the sequence
+ seq = malloc(l_mseq + (end - beg));
+ ref = seq + l_mseq;
diff --git a/debian/patches/series b/debian/patches/series
index 205560e..d2dadad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,5 @@
+fix_heap_block_overrun
+fix_wrong_type_casting
fix_build_on_freebsd.patch
check_number_of_arguments.patch
spelling.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/bwa.git
More information about the debian-med-commit
mailing list