rem: crc_list.push(format("%lx %s",crc32,fname)); 
add: crc_list.push(format("%08lx %s",crc32,fname)); 
context: function complete_file(file, fname, attachment_dir){	printf("Completing attachment: %s\r\n",fname);	md5=file.md5_hex;	crc32=file.crc32;	file.close();	for(mi=0;mi<md5_list.length;mi++)		if(md5_list[mi].substr(0,32)==md5)			break;	if(mi<md5_list.length) {		printf("Duplicate MD5 digest found: %s\r\n",md5_list[mi]);		return(false);	}	md5_list.push(format("%s %s",md5,fname));	for(ci=0;ci<crc_list.length;ci++)		if(parseInt(crc_list[ci],16)==crc32)			break;	if(ci<crc_list.length) {		printf("Duplicate CRC-32 found: %s\r\n",crc_list[ci]);		return(false);	}	crc_list.push(format("%lx %s",crc32,fname));	new_fname=fname;	file_num=0;	while(file_exists(attachment_dir + new_fname) && file_num<1000) { 		// generate unique name, if necessary		ext=fname.lastIndexOf('.');		if(ext<0)			ext="";		else			ext=fname.slice(ext);		// Convert filename.ext to filename.<article>.ext		new_fname=format("%.*s.%lu%s",fname.length-ext.length,fname,file_num++,ext);	}	fname=attachment_dir + new_fname;	if(!file_rename(file.name,fname)) {		printf("Error %d renaming %s to %s\r\n",errno,file.name,fname);		return(false);	}	printf("Attachment saved as: %s\r\n",fname);	completed_files++;	return(true);}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/947ee486523c91cfaf8e1d7633293dac6d195c53/binarydecoder.js/buggy/binarydecoder.js