Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sicos2002 committed Jul 2, 2015
2 parents 86306ae + d3c4f00 commit 9393e27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MsgReader/Outlook/MapiTagMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ internal List<MapiTagMapping> GetMapping(IEnumerable<string> 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
Expand Down Expand Up @@ -106,6 +109,7 @@ internal List<MapiTagMapping> GetMapping(IEnumerable<string> 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;
Expand Down

0 comments on commit 9393e27

Please sign in to comment.