| 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 |
This is a copy of the patch written for the bwa Debian package. |
| 6 |
Last-Update: 2017-06-30 |
| 7 |
|
| 8 |
====================================================================== |
| 9 |
--- a/bwa-apache2/ksw.c |
| 10 |
+++ b/bwa-apache2/ksw.c |
| 11 |
@@ -421,7 +421,7 @@ |
| 12 |
assert(h0 > 0); |
| 13 |
// allocate memory |
| 14 |
qp = malloc(qlen * m); |
| 15 |
- eh = calloc(qlen + 1, 8); |
| 16 |
+ eh = calloc(qlen + 2, 8); |
| 17 |
// generate the query profile |
| 18 |
for (k = i = 0; k < m; ++k) { |
| 19 |
const int8_t *p = &mat[k * m]; |