You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes a file will arrive with no filename property set. Calling decoded filename on such an attachment results in a memory access crash -- the nil pointer is converted to a char* and used for comparison, which causes the crash.
Sometimes a file will arrive with no filename property set. Calling decoded filename on such an attachment results in a memory access crash -- the nil pointer is converted to a char* and used for comparison, which causes the crash.
One potential fix is:
-(NSString *)decodedFilename {
if (self.filename) {
return MailCoreDecodeMIMEPhrase((char *)[self.filename UTF8String]);
}
else {
return nil;
}
}
You could also be smarter about it and return a generic filetype with the correct ending based on the mime type.
The text was updated successfully, but these errors were encountered: