Sorry,

Should be an extra comment line in the patch to make it more obvious... 
It's 11 chars + 9 chars + 1 char for the terminating null terminator = 21 
chars!

DT

On Tuesday, September 4, 2012 3:59:16 PM UTC-5, Dave Trudgian wrote:
>
> Here's a patch that fixes the problem (for me).
>
> The problem occurs where TandemResultsParser writePepXML() code is sending 
> a filename and a string buffer to rampConstructInputFileName in the 
> RAMPFace code. It's trying to add prefixes/extension to the tandem filename 
> in order to find the corresponding mzXML/mzML file. Unfortunately the 
> buffer declaration is too short. The longest prefix/extension combination 
> tried is 21 characters. The buffer is declared in TandemResultsParser only 
> as the original filename length +20 chars.
>
> This was difficult to hunt down, as the prefixes are specified in 
> TandemResultsParser, with the suffixes in RAMPFace - also the crash occurs 
> where the RAMPFace code tries adding additional '/' at the start of the 
> string, over and above the prefixes that are passed in by the 
> TandemResultsParser code. This seems pointless, as it will result in search 
> paths above from the root directory, e.g. 
>
> /../../EColi_07_10_12_1microlitre_01.tandem.mzXML.gz
>
> ... but I've left this behavior and just modified the buffer size.
>
> Whether or not the problem code causes a complete crash will depend on 
> what else is around in the memory at the relevant location at the time. I 
> guess in my case I saw no problems with gzipped files due to where things 
> were being allocated in memory from my particular build of TPP on this 
> machine.
>
> DT
>
>
>
> Apply to src/Parsers/Algorithm2XML/Tandem2XML/TandemResultsParser.cxx
> NB: line numbers might be slightly off. This is against previous TPP 
> release.
>
> @@ -678,7 +678,10 @@ bool TandemResultsParser::writePepXML()
>                 if (strMzXMLFile.length() >= 5 && 
> strMzXMLFile.compare(strMzXMLFile.length() - 5, 5, ".xtan") == 0)
>                         strMzXMLFile.erase(strMzXMLFile.length() - 5);
>                 int len;
> -               char *fname=new char[len=strMzXMLFile.length()+20];
> +               // DCT fix: buffer needs to have additional 21 chars, not 
> 20:
> +               //          longest prefix tried is /../../xml/         11 
> chars
> +               //          longest suffix tried is .mzXML.gz           9 
> chars 
> +               char *fname=new char[len=strMzXMLFile.length()+21];
>  
>                 rampConstructInputFileName(fname,len,strMzXMLFile.data());
>                  pf = rampOpenFile(fname);
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"spctools-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/spctools-discuss/-/XXnZTDbx2ToJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/spctools-discuss?hl=en.

Reply via email to