fix(tnef): add protection against malformed winmail.dat

This commit is contained in:
Hivert Quentin
2025-03-26 16:22:12 +01:00
parent 4be3ba227c
commit 7c6b6743e0

View File

@@ -291,6 +291,11 @@ unsigned char GetRruleMonthNum(unsigned char a, unsigned char b) {
partName = nil;
data = [self fetchBLOB];
if((int)[data length] < sizeof(DWORD)) {
NSLog(@"TNEF: ERROR try to decode empty data where it should'nt");
return;
}
memcpy(&signature, [data bytes], sizeof(DWORD));
if (TNEFCheckForSignature(signature) == 0)
{