[med-svn] [Git][med-team/sumaclust][master] 2 commits: Reading ACGT-only sequences safely

Pierre Gruet gitlab at salsa.debian.org
Wed Apr 8 21:04:03 BST 2020



Pierre Gruet pushed to branch master at Debian Med / sumaclust


Commits:
b68b92e6 by Pierre Gruet at 2020-04-08T21:49:04+02:00
Reading ACGT-only sequences safely

Better handling of line changes

- - - - -
1aa21e7d by Pierre Gruet at 2020-04-08T21:57:46+02:00
Updating changelog

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/reading_only_ACGT_sequences_safely.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+sumaclust (1.0.35-3) UNRELEASED; urgency=medium
+
+  * Adding a patch to read ACGT-only sequences safely, fixing regression
+    on amd64 (Closes: #956232)
+
+ -- Pierre Gruet <pgtdebian at free.fr>  Wed, 08 Apr 2020 21:49:49 +0200
+
 sumaclust (1.0.35-2) unstable; urgency=medium
 
   * Updating fix_build patch after new upstream version


=====================================
debian/patches/reading_only_ACGT_sequences_safely.patch
=====================================
@@ -0,0 +1,40 @@
+From: Pierre Gruet <pgtdebian at free.fr>
+Date: Wed, 8 Apr 2020 11:18:01 +0200
+Subject: Reading only-ACGT sequences safely
+
+---
+ sumalibs/libfasta/sequence.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/sumalibs/libfasta/sequence.c b/sumalibs/libfasta/sequence.c
+index 2cf3d10..db999f8 100755
+--- a/sumalibs/libfasta/sequence.c
++++ b/sumalibs/libfasta/sequence.c
+@@ -162,19 +162,25 @@ void seq_fillSeqOnlyATGC(char *seq, fastaSeqPtr seqElem, int seqLen)
+ {
+ 	char* seqTemp;
+ 	char c;
+-	int32_t index = 0, seqIndex = 0, len = strlen(seq);
++	int32_t index = 1, seqIndex = 0, len = strlen(seq);
+ 	char* seqAlphabets = "acgtACGT";
+ 	int notAllATGC = 0;
++        int goOnParsing = 1;
+ 
+ 	seqTemp = (char*) util_malloc(seqLen*sizeof(char), __FILE__, __LINE__);
+ 
+-	while (index < len)
++	while (goOnParsing)
+ 	{
+ 		c = seq[index++];
+ 		if (strchr(seqAlphabets, c) != NULL)
+ 			seqTemp[seqIndex++] = tolower(c);
++                else if (c == '\n')
++                        goOnParsing = 0; //End of line character terminating the sequence has been reached.
+ 		else if (c != '\n')
+ 			notAllATGC = 1;
++                
++                if (index == len)
++                        goOnParsing = 0;
+ 	}
+ 
+ 	if (notAllATGC)


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 hardening.patch
 fix_build.patch
+reading_only_ACGT_sequences_safely.patch



View it on GitLab: https://salsa.debian.org/med-team/sumaclust/-/compare/954b3e6a483f5015fc15c858211fd971848b8628...1aa21e7dde4907231c67fe9e91da8d91d54316b2

-- 
View it on GitLab: https://salsa.debian.org/med-team/sumaclust/-/compare/954b3e6a483f5015fc15c858211fd971848b8628...1aa21e7dde4907231c67fe9e91da8d91d54316b2
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200408/2964028f/attachment-0001.html>


More information about the debian-med-commit mailing list