From 8f89f55484c40ff7f64b9041bb6c593ced5fbbce Mon Sep 17 00:00:00 2001 From: Heng Li Date: Thu, 17 Nov 2011 22:13:38 -0500 Subject: [PATCH] fixed a segfault when there are too few good bases. --- bntseq.c | 1 + bwtsw2_aux.c | 2 +- main.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bntseq.c b/bntseq.c index 98a5a494..adcd2d78 100644 --- a/bntseq.c +++ b/bntseq.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "bntseq.h" #include "main.h" #include "utils.h" diff --git a/bwtsw2_aux.c b/bwtsw2_aux.c index 5d57ba85..4ac11fdb 100644 --- a/bwtsw2_aux.c +++ b/bwtsw2_aux.c @@ -574,7 +574,7 @@ static void bsw2_aln_core(bsw2seq_t *_seq, const bsw2opt_t *_opt, const bntseq_t rseq[1][i] = c; } if (l - k < opt.t) { // too few unambiguous bases - buf[x] = 0; + buf[x] = calloc(1, sizeof(bwtsw2_t)); free(seq[0]); continue; } // alignment diff --git a/main.c b/main.c index 3e9a6d48..d15d14ff 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.6.0-r85" +#define PACKAGE_VERSION "0.6.0-r89-dev" #endif static int usage()