Skip to content

Commit

Permalink
Mask Short values when converting to int to prevent sign extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmcleodfoss committed Jul 22, 2020
1 parent 2c239ac commit 0322eea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pst/src/main/java/io/github/jmcleodfoss/pst/BBTEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class BBTEntry implements BTreeLeaf
DataContainer dc = new DataContainer();
dc.read(entryStream, context.unicode() ? unicode_fields : ansi_fields, common_fields);
bref = (BREF)dc.get(nm_bref);
numBytes = (Short)dc.get(nm_cb);
refCount = (Short)dc.get(nm_cRef);
numBytes = 0xffff & (Short)dc.get(nm_cb);
refCount = 0xffff & (Short)dc.get(nm_cRef);
}

/** Obtain the actual size of a block B-tree leaf node as read in from the input datastream.
Expand Down

0 comments on commit 0322eea

Please sign in to comment.