[med-svn] samtools 10/26: Remove incorrect parameter check

Charles Plessy plessy at moszumanska.debian.org
Tue Dec 10 10:06:25 UTC 2013


This is an automated email from the git hooks/post-receive script.

plessy pushed a commit to branch debian/unstable
in repository samtools.

commit 4a18e5f6bab6a6415a066b6e768981b045855194
Author: John Marshall <jm18 at sanger.ac.uk>
Date:   Wed Nov 27 16:15:54 2013 +0000

    Remove incorrect parameter check
    
    The q parameter is an m*m matrix, and is allocated by the caller and
    m & q are passed in accordingly.  It appears that this check may have been
    intended to be "if (m > qmax)" but we have no independent idea of the size
    of q, so there's no way to validate m against it.
    
    Values in q are computed from aux.bsum[k]/etc where 0 <= k < m, so m is
    also limited by the size of bsum[], namely 16.  However meaningful indices
    for bsum/etc mostly are 0...4 (i.e., A,C,G,T,N) and in practice (currently)
    m is either 4 or 5 (with q sized accordingly).  So checking "if (m > 16)"
    would be somewhat pointless.
---
 errmod.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/errmod.c b/errmod.c
index 1ad63a2..3ea58e8 100644
--- a/errmod.c
+++ b/errmod.c
@@ -109,7 +109,6 @@ int errmod_cal(const errmod_t *em, int n, int m, uint16_t *bases, float *q)
 	// The total count of each base observed per strand
 	int w[32];
 
-	if (m > m) return -1; // FIXME: This looks like a typo?
         /* zero out q */
 	memset(q, 0, m * m * sizeof(float));
 	if (n == 0) return 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/samtools.git



More information about the debian-med-commit mailing list