]> source.dussan.org Git - poi.git/commit
Bug #60977 writing XSSF with custom properties twice corrupts output
authorGreg Woolsey <gwoolsey@apache.org>
Fri, 11 Jan 2019 18:20:03 +0000 (18:20 +0000)
committerGreg Woolsey <gwoolsey@apache.org>
Fri, 11 Jan 2019 18:20:03 +0000 (18:20 +0000)
commit8b69fcc642981c773f5ac35264813b8d65e91cf2
tree7453af8a2b3ad74516a81fd5df2421348de5fe0e
parent131e3ee0ed3f5b6ef1ee65ce5f93b8193ea827cd
Bug #60977 writing XSSF with custom properties twice corrupts output

turns out the output XML data buffer for the custom properties document was appended to, not replaced, when writing in the presence of existing content.  Now clearing output buffer first in this case.  When first creating custom properties, i.e. first write after changes, there is no buffer yet, so nothing to clear.

Does not affect any read operations, or other writes beyond custom properties, as that was where the problem lay, not down in the Zip stuff.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1851084 13f79535-47bb-0310-9956-ffa450edef68
src/ooxml/java/org/apache/poi/ooxml/POIXMLProperties.java
src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java