From fc2e1607d73ea4870e6f396697c79051aff23eed Mon Sep 17 00:00:00 2001 From: Pesho Ivanov Date: Wed, 3 Jan 2024 17:06:08 +0300 Subject: [PATCH 1/2] Update paftools.js (#1145) In mapeval "-Q INT" reports wrong alignments with mapQ>=INT, not with mapQ>INT --- misc/paftools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/paftools.js b/misc/paftools.js index e640f95..c0c4eee 100755 --- a/misc/paftools.js +++ b/misc/paftools.js @@ -2076,7 +2076,7 @@ function paf_mapeval(args) warn("Usage: paftools.js mapeval [options] |"); warn("Options:"); warn(" -r FLOAT mapping correct if overlap_length/union_length>FLOAT [" + ovlp_ratio + "]"); - warn(" -Q INT print wrong mappings with mapQ>INT [don't print]"); + warn(" -Q INT print wrong mappings with mapQ>=INT [don't print]"); warn(" -m INT 0: eval the longest aln only; 1: first aln only; 2: all primary aln [0]"); exit(1); } From f3e59fc2a09e89fdb2c166b6d02281e98288c326 Mon Sep 17 00:00:00 2001 From: blawrence-ont <132677418+blawrence-ont@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:32:05 +0000 Subject: [PATCH 2/2] Avoid NULL pointer dereference (#1154) If the allocated region is 0 bytes then it's unsafe to dereference it. Fixes #1147. --- index.c | 1 + 1 file changed, 1 insertion(+) diff --git a/index.c b/index.c index 0d8a2ae..cd8b40e 100644 --- a/index.c +++ b/index.c @@ -192,6 +192,7 @@ int32_t mm_idx_cal_max_occ(const mm_idx_t *mi, float f) if (f <= 0.) return INT32_MAX; for (i = 0; i < 1<b; ++i) if (mi->B[i].h) n += kh_size((idxhash_t*)mi->B[i].h); + if (n == 0) return INT32_MAX; a = (uint32_t*)malloc(n * 4); for (i = n = 0; i < 1<b; ++i) { idxhash_t *h = (idxhash_t*)mi->B[i].h;