summaryrefslogtreecommitdiffstats
path: root/academic/wise/patches/08_mayhem.patch
diff options
context:
space:
mode:
Diffstat (limited to 'academic/wise/patches/08_mayhem.patch')
-rw-r--r--academic/wise/patches/08_mayhem.patch103
1 files changed, 103 insertions, 0 deletions
diff --git a/academic/wise/patches/08_mayhem.patch b/academic/wise/patches/08_mayhem.patch
new file mode 100644
index 0000000000..c54c7c66ab
--- /dev/null
+++ b/academic/wise/patches/08_mayhem.patch
@@ -0,0 +1,103 @@
+Author: Philipp Benner <philipp@debian.org>
+Last-Update: Sun, 07 Jul 2013 13:33:01 +0200
+Description: Fix run time errors detected by Mayhem
+
+--- wise-2.4.1.orig/src/models/dbac.c
++++ wise-2.4.1/src/models/dbac.c
+@@ -535,8 +535,12 @@
+ *
+ */
+
+- one = read_fasta_file_Sequence(*argv++);
+- two = read_fasta_file_Sequence(*argv++);
++ if( (one = read_fasta_file_Sequence(*argv++)) == NULL ) {
++ fatal("Unable to read the sequence in file");
++ }
++ if( (two = read_fasta_file_Sequence(*argv++)) == NULL ) {
++ fatal("Unable to read the sequence in file");
++ }
+
+ uppercase_Sequence(one);
+ uppercase_Sequence(two);
+--- wise-2.4.1.orig/src/models/estwise.c
++++ wise-2.4.1/src/models/estwise.c
+@@ -313,7 +313,7 @@
+ }
+ }
+
+- if( reverse == TRUE ) {
++ if( cdna && reverse == TRUE ) {
+ if( tstart > tend ) {
+ warn("You have already reversed the DNA by using %d - %d truncation. Re-reversing",tstart,tend);
+ }
+@@ -323,7 +323,7 @@
+ cdna = cdna_temp;
+ }
+
+- if( target_abs == TRUE ) {
++ if( cdna && target_abs == TRUE ) {
+ cdna->baseseq->offset = 1;
+ cdna->baseseq->end = strlen(cdna->baseseq->seq);
+ }
+@@ -472,8 +472,11 @@
+ }
+
+ cp = flat_cDNAParser(indel_error);
+- cm = flat_CodonMapper(ct);
+- sprinkle_errors_over_CodonMapper(cm,subs_error);
++
++ if( ct ) {
++ cm = flat_CodonMapper(ct);
++ sprinkle_errors_over_CodonMapper(cm,subs_error);
++ }
+
+ return ret;
+
+--- wise-2.4.1.orig/src/models/genewise.c
++++ wise-2.4.1/src/models/genewise.c
+@@ -550,8 +550,10 @@
+ ret = FALSE;
+ }
+
+- gen->baseseq->offset = 1;
+- gen->baseseq->end = strlen(gen->baseseq->seq);
++ if ( gen ) {
++ gen->baseseq->offset = 1;
++ gen->baseseq->end = strlen(gen->baseseq->seq);
++ }
+ }
+
+ if( alg_str != NULL ) {
+--- wise-2.4.1.orig/src/models/estwisedb.c
++++ wise-2.4.1/src/models/estwisedb.c
+@@ -688,8 +688,11 @@
+
+
+ cps = flat_cDNAParser(indel_error);
+- cm = flat_CodonMapper(ct);
+- sprinkle_errors_over_CodonMapper(cm,subs_error);
++
++ if( ct ) {
++ cm = flat_CodonMapper(ct);
++ sprinkle_errors_over_CodonMapper(cm,subs_error);
++ }
+
+ return ret;
+
+--- wise-2.4.1.orig/src/models/promoterwise.c
++++ wise-2.4.1/src/models/promoterwise.c
+@@ -147,8 +147,12 @@
+
+ lchs = standard_LocalCisHitScore(NMaskType_VARIABLE);
+
+- query = read_fasta_file_Sequence(argv[1]);
+- target = read_fasta_file_Sequence(argv[2]);
++ if( (query = read_fasta_file_Sequence(argv[1])) == NULL ) {
++ fatal("Unable to read the sequence in query file");
++ }
++ if( (target = read_fasta_file_Sequence(argv[2])) == NULL ) {
++ fatal("Unable to read the sequence in target file");
++ }
+
+ for(i=0;i<query->len;i++) {
+ query->seq[i] = toupper(query->seq[i]);