diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-11-04 09:13:05 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-11-04 09:13:05 +0000 |
commit | c838c6cd6c0b485d0bc2d806d2faf8d62cf8ac56 (patch) | |
tree | e1da53fbff0e141cc6c2de31fa8c8cce38710c8b | |
parent | c4a0266cb38c7f98f3efc74be805c4028b0518e8 (diff) | |
download | poi-c838c6cd6c0b485d0bc2d806d2faf8d62cf8ac56.tar.gz poi-c838c6cd6c0b485d0bc2d806d2faf8d62cf8ac56.zip |
[bug-66335] apply rest of fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1905062 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/PropertiesChunk.java | 4 | ||||
-rw-r--r-- | poi-scratchpad/src/test/java/org/apache/poi/hsmf/TestFileRead.java | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/PropertiesChunk.java b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/PropertiesChunk.java index 809411bfb2..cdc146d980 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/PropertiesChunk.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/PropertiesChunk.java @@ -255,7 +255,7 @@ public abstract class PropertiesChunk extends Chunk { // to another chunk which holds the data itself boolean isPointer = false; int length = type.getLength(); - if (!type.isFixedLength()) { + if (type.isPointer()) { isPointer = true; length = 8; } @@ -380,7 +380,7 @@ public abstract class PropertiesChunk extends Chunk { LittleEndian.putUInt(value.getFlags(), out); // readable + writable MAPIType type = getTypeMapping(value.getActualType()); - if (type.isFixedLength()) { + if (type.isFixedLength() && !type.isPointer()) { // page 11, point 2.1.2 writeFixedLengthValueHeader(out, property, type, value); } else { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hsmf/TestFileRead.java b/poi-scratchpad/src/test/java/org/apache/poi/hsmf/TestFileRead.java index 21f95be629..71c6807431 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hsmf/TestFileRead.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hsmf/TestFileRead.java @@ -12,8 +12,7 @@ public class TestFileRead { void bug66335() throws IOException { try (MAPIMessage mapiMessage = new MAPIMessage( POIDataSamples.getHSMFInstance().getFile("bug66335.msg"))) { - // 25 is not the right number of properties but it is what the existing code finds - assertEquals(25, mapiMessage.getMainChunks().getProperties().size()); + assertEquals(151, mapiMessage.getMainChunks().getProperties().size()); } } } |