Current the recovery SpamFilter version crashes when garbled characters are added to a filename when opening the file.
For example: email5 becomes email5% or email5+
The error checking identifies an incorrect filename passed to it....I think there may be a bug in the BufferedReader or
the FileInputStream that causes this problem and passes a wrong filename to the nativeopen().
#else
int length=VAR(___filename___)->___length___;
char* filename= (((char *)&VAR(___filename___)->___length___)+sizeof(int));
- int fd=open(filename, O_RDONLY, 0);
+ int fd;
+ if ((fd=open(filename, O_RDONLY, 0)) < 0) {
+ printf(">>>\n");
+ perror("open failed");
+ printf("filename is %s\n", filename);
+ system("pwd");
+ printf("<<<\n");
+ }
return fd;
#endif
}
if (numBytes<toread)
toread=numBytes;
- status=read(fd, string, toread);
+ if ((status=read(fd, string, toread)) < 0) {
+ perror("");
+ }
return status;
#endif
}