rem: file.remove(); 
context: function combine_parts(list,attachment_dir){	var li;	for(li=0; li<list.length; li++) {		if(list[li].parts!=list[li].total)			continue;		var obj=list[li];		var sub_code;		printf("File complete: %s (%u parts)\r\n", obj.name, obj.parts);		file = new File(system.temp_dir + "binary.tmp");		if(!file.open("w+b")) {			printf("!ERROR %d opening/creating %s\r\n", file.error, file.name);			continue;		}		file[obj.codec]=true;	/* yenc or uue */		var pi;		for(pi=1;pi<=obj.total;pi++) {			printf("Processing part %u of %u\r\n",pi,obj.total);			var prefix=format("part%u.",pi);			sub_code=obj[prefix + "sub"];			msgbase=new MsgBase(sub_code);			if(msgbase.open()==false) {				printf("!ERROR %s opening msgbase: %s\r\n",msgbase.last_error,sub_code);				delete msgbase;				break;			}			ptr=obj[prefix + "msg"];			body = msgbase.get_msg_body(					 false	/* retrieve by offset */					,ptr	/* message number */					,false	/* remove ctrl-a codes */					,false	/* rfc822 formatted text */					,false	/* include tails */					);			if(body == null) {				printf("!FAILED to read message number %ld\r\n",ptr);				break;			}			lines=body.split("\r\n");			first_line=obj[prefix + "first_line"];			last_line=obj[prefix + "last_line"];			for(var l=first_line;l<=last_line;l++)				file.write(lines[l]);			delete msgbase;		}		if(pi<=obj.total) {			file.remove();			printf("!Combine failure, removing part %u\r\n",pi);			list[li][format("part%u.id",pi)]=undefined;			continue;		}		if(obj.size!=undefined && obj.size!=file.length) {			file.remove();			printf("!File length mismatch, actual: %lu, expected: %lu\r\n"				,file.length, obj.size);			continue;		}		/* Verify final CRC-32, if available */		if(obj.crc32!=undefined) {			file_crc32=file.crc32;			crc32=parseInt(obj.crc32,16);			if(crc32!=file_crc32) {				file.remove();				printf("!CRC-32 failure, actual: %08lx, expected: %08lx\r\n"					,file_crc32, crc32);				continue;			}		}		complete_file(file			,obj.name.toString()			,msg_area.sub[sub_code].attachment_dir);		// Remove file entry from database		list.splice(li--,1);		parts_list_modified=true;	}}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/aadce30ad22fd8c3d66746c79266b818a0022b16/binarydecoder.js/buggy/binarydecoder.js