* change strlen(url) to strlen(ptrt) since the string under ptr is being
added to filename, not the whole URL.
* also add a few extra magic bytes to make it clear that there is space
for delimiters and termination bytes. These were previously hidden as
extra bytes in the URL prefix length.
Should resolve Coverity Scan false positive issue 740414
if ( ptr == 0 || strlen(ptr) < 4 ) return false;
// create filename to store contents into
- char *filename = new char[ strlen(url) + strlen(copydir) + strlen(index) ];
+ // NP: magic extra 5 bytes for the component delimiter and termination octets
+ char *filename = new char[ strlen(ptr) + strlen(copydir) + strlen(index) +5 ];
assert( filename != 0 );
strcpy( filename, copydir );
strcat( filename, "/" );