Debian Codegraph @

debian/patches/fix_heap_block_overrun

raw
1 Author: Nadiya Sitdykova
2 Description: allocate more memory so the heap block overrun wouldn't
3 happen (when qlen = 0). Issue was spotted by valgrind during
4 investigation of bug https://github.com/lh3/bwa/issues/108
5 Last-Update: 2017-06-30
6
7 ======================================================================
8 --- bwa.orig/ksw.c
9 +++ bwa/ksw.c
10 @@ -421,7 +421,7 @@
11 assert(h0 > 0);
12 // allocate memory
13 qp = malloc(qlen * m);
14 - eh = calloc(qlen + 1, 8);
15 + eh = calloc(qlen + 2, 8);
16 // generate the query profile
17 for (k = i = 0; k < m; ++k) {
18 const int8_t *p = &mat[k * m];