| 1 | Descriptionscip-debian debian ampliconnoise 1.29-17 ampliconnoise/patches/`fix-segfault-on-non-fasta-input.patch`#Description.: Some apps segfault when non-FASTA data is inputted, and this is flagged as a security |
| 2 | concern. I suspect there are still ways to segfault this app, but at least this fixes |
| 3 | an obvious crash. |
| 4 | Also fixes https://code.google.com/p/ampliconnoise/issues/detail?id=10 |
| 5 | . |
| 6 | The package is orphaned upstream, hence not forwarded. |
| 7 | Forwardedscip-debian debian ampliconnoise 1.29-17 ampliconnoise/patches/`fix-segfault-on-non-fasta-input.patch`#Forwarded.: no |
| 8 | Authorscip-debian debian ampliconnoise 1.29-17 ampliconnoise/patches/`fix-segfault-on-non-fasta-input.patch`#Author.: Tim Booth |
| 9 | Last-Updatescip-debian debian ampliconnoise 1.29-17 ampliconnoise/patches/`fix-segfault-on-non-fasta-input.patch`#Last-Update.: 2013-06-27 |
| 10 | |
| 11 | --- a/FastaUnique/FastaUnique.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`FastaUnique/FastaUnique.c`: |
| 12 | +++ b/FastaUnique/FastaUnique.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`FastaUnique/FastaUnique.c`: |
| 13 | @@ -39,6 +39,13 @@ void readData(t_Data *ptData, t_Params * |
| 14 | nPos = 0; |
| 15 | } |
| 16 | else{ |
| 17 | + //If there is no > on first line we're heading for a segfault. |
| 18 | + if(! ptData->nSeq) |
| 19 | + { |
| 20 | + fprintf(stderr, "File %s does not appear to be in FASTA format.\n", ptParams->szInputFile); |
| 21 | + exit(EXIT_FAILURE); |
| 22 | + } |
| 23 | + |
| 24 | i = 0; |
| 25 | while(strrchr(szSequence,szLine[i]) != NULL){ |
| 26 | i++; |
| 27 | @@ -46,6 +53,10 @@ void readData(t_Data *ptData, t_Params * |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | + //Maybe the final sequence was the longest? |
| 32 | + if(nPos > ptData->nMaxLen){ |
| 33 | + ptData->nMaxLen = nPos; |
| 34 | + } |
| 35 | |
| 36 | fclose(ifp); |
| 37 | } |
| 38 | --- a/NDist/NDist.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`NDist/NDist.c`: |
| 39 | +++ b/NDist/NDist.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`NDist/NDist.c`: |
| 40 | @@ -654,6 +654,13 @@ void readData(t_Data *ptData, t_Params * |
| 41 | nPos = 0; |
| 42 | } |
| 43 | else{ |
| 44 | + //If there is no > on first line we're heading for a segfault. |
| 45 | + if(! ptData->nSeq) |
| 46 | + { |
| 47 | + fprintf(stderr, "File %s does not appear to be in FASTA format.\n", ptParams->szInputFile); |
| 48 | + exit(EXIT_FAILURE); |
| 49 | + } |
| 50 | + |
| 51 | i = 0; |
| 52 | while(strrchr(szSequence,szLine[i]) != NULL){ |
| 53 | i++; |
| 54 | @@ -661,6 +668,10 @@ void readData(t_Data *ptData, t_Params * |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | + //Maybe the final sequence was the longest? |
| 59 | + if(nPos > ptData->nMaxLen){ |
| 60 | + ptData->nMaxLen = nPos; |
| 61 | + } |
| 62 | |
| 63 | fclose(ifp); |
| 64 | } |
| 65 | --- a/Perseus/Perseus.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`Perseus/Perseus.c`: |
| 66 | +++ b/Perseus/Perseus.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`Perseus/Perseus.c`: |
| 67 | @@ -793,6 +793,13 @@ void readData(char* szInputFile, t_Data |
| 68 | nPos = 0; |
| 69 | } |
| 70 | else{ |
| 71 | + //If there is no > on first line we're heading for a segfault. |
| 72 | + if(! ptData->nSeq) |
| 73 | + { |
| 74 | + fprintf(stderr, "File %s does not appear to be in FASTA format.\n", szInputFile); |
| 75 | + exit(EXIT_FAILURE); |
| 76 | + } |
| 77 | + |
| 78 | i = 0; |
| 79 | while(strrchr(szSequence,szLine[i]) != NULL){ |
| 80 | i++; |
| 81 | @@ -800,6 +807,10 @@ void readData(char* szInputFile, t_Data |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | + //Maybe the final sequence was the longest? |
| 86 | + if(nPos > ptData->nMaxLen){ |
| 87 | + ptData->nMaxLen = nPos; |
| 88 | + } |
| 89 | |
| 90 | fclose(ifp); |
| 91 | } |
| 92 | --- a/PerseusD/PerseusD.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`PerseusD/PerseusD.c`: |
| 93 | +++ b/PerseusD/PerseusD.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`PerseusD/PerseusD.c`: |
| 94 | @@ -844,6 +844,13 @@ void readData(char* szInputFile, t_Data |
| 95 | nPos = 0; |
| 96 | } |
| 97 | else{ |
| 98 | + //If there is no > on first line we're heading for a segfault. |
| 99 | + if(! ptData->nSeq) |
| 100 | + { |
| 101 | + fprintf(stderr, "File %s does not appear to be in FASTA format.\n", szInputFile); |
| 102 | + exit(EXIT_FAILURE); |
| 103 | + } |
| 104 | + |
| 105 | i = 0; |
| 106 | while(strrchr(szSequence,szLine[i]) != NULL){ |
| 107 | i++; |
| 108 | @@ -851,6 +858,10 @@ void readData(char* szInputFile, t_Data |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | + //Maybe the final sequence was the longest? |
| 113 | + if(nPos > ptData->nMaxLen){ |
| 114 | + ptData->nMaxLen = nPos; |
| 115 | + } |
| 116 | |
| 117 | fclose(ifp); |
| 118 | } |
| 119 | --- a/SeqDist/SeqDist.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`SeqDist/SeqDist.c`: |
| 120 | +++ b/SeqDist/SeqDist.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`SeqDist/SeqDist.c`: |
| 121 | @@ -799,6 +799,13 @@ void readData(t_Data *ptData, t_Params * |
| 122 | nPos = 0; |
| 123 | } |
| 124 | else{ |
| 125 | + //If there is no > on first line we're heading for a segfault. |
| 126 | + if(! ptData->nSeq) |
| 127 | + { |
| 128 | + fprintf(stderr, "File %s does not appear to be in FASTA format.\n", ptParams->szInputFile); |
| 129 | + exit(EXIT_FAILURE); |
| 130 | + } |
| 131 | + |
| 132 | i = 0; |
| 133 | while(strrchr(szSequence,szLine[i]) != NULL){ |
| 134 | i++; |
| 135 | @@ -806,6 +813,10 @@ void readData(t_Data *ptData, t_Params * |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | + //Maybe the final sequence was the longest? |
| 140 | + if(nPos > ptData->nMaxLen){ |
| 141 | + ptData->nMaxLen = nPos; |
| 142 | + } |
| 143 | |
| 144 | fclose(ifp); |
| 145 | } |
| 146 | --- a/SeqNoise/SeqNoise.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`SeqNoise/SeqNoise.c`: |
| 147 | +++ b/SeqNoise/SeqNoise.cscip-debian debian ampliconnoise 1.29-17 ampliconnoise/upstream/`SeqNoise/SeqNoise.c`: |
| 148 | @@ -571,6 +571,13 @@ void readData(t_Data *ptData, t_Params * |
| 149 | nPos = 0; |
| 150 | } |
| 151 | else{ |
| 152 | + //If there is no > on first line we're heading for a segfault. |
| 153 | + if(! ptData->nSeq) |
| 154 | + { |
| 155 | + fprintf(stderr, "File %s does not appear to be in FASTA format.\n", ptParams->szDataFile); |
| 156 | + exit(EXIT_FAILURE); |
| 157 | + } |
| 158 | + |
| 159 | i = 0; |
| 160 | while(strrchr(szSequence,szLine[i]) != NULL){ |
| 161 | i++; |
| 162 | @@ -578,6 +585,10 @@ void readData(t_Data *ptData, t_Params * |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | + //Maybe the final sequence was the longest? |
| 167 | + if(nPos > ptData->nMaxLen){ |
| 168 | + ptData->nMaxLen = nPos; |
| 169 | + } |
| 170 | |
| 171 | fclose(ifp); |
| 172 | } |