diff --git a/MsgReader/Outlook/MapiTagMapper.cs b/MsgReader/Outlook/MapiTagMapper.cs index bbc91697..cb8ef269 100644 --- a/MsgReader/Outlook/MapiTagMapper.cs +++ b/MsgReader/Outlook/MapiTagMapper.cs @@ -77,6 +77,9 @@ internal List GetMapping(IEnumerable propertyIdents) var entryStreamBytes = GetStreamBytes(MapiTags.EntryStream); var stringStreamBytes = GetStreamBytes(MapiTags.StringStream); + if (entryStreamBytes.Length == 0) + return result; + foreach (var propertyIdent in propertyIdents) { // To read the correct mapped property we need to calculate the offset in the entry stream @@ -106,6 +109,7 @@ internal List GetMapping(IEnumerable propertyIdents) { var stringOffset = ushort.Parse(entryIdentString, NumberStyles.HexNumber); + if (stringOffset >= stringStreamBytes.Length) continue; // Read the first 4 bytes to determine the length of the string to read var stringLength = BitConverter.ToInt32(stringStreamBytes, stringOffset); var str = string.Empty;