Bug 64595 - [PATCH] Missing quoting of pre-evaluated string values in formula cells causes corrupt files
Summary: [PATCH] Missing quoting of pre-evaluated string values in formula cells cause...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC Linux
: P2 regression (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-12 18:43 UTC by Bastian Isensee
Modified: 2020-07-13 17:34 UTC (History)
1 user (show)



Attachments
Patch to quote cell values for formula cells with pre-evaluated string contents (1.01 KB, patch)
2020-07-12 19:11 UTC, Bastian Isensee
Details | Diff
Plain text patch to quote cell values for formula cells with pre-evaluated string contents (2.59 KB, patch)
2020-07-13 17:20 UTC, Bastian Isensee
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bastian Isensee 2020-07-12 18:43:04 UTC
When writing a formula with a precalculated value special characters are not quoted in SheetDataWriter.java which may cause a corrupt file.
The issue only occurs when using the streaming implementation SXSSF. Earlier POI versions did not have this issue. It occured only after updating to a more-recent Java 11 compatible version.
Comment 1 Bastian Isensee 2020-07-12 19:11:56 UTC
Created attachment 37360 [details]
Patch to quote cell values for formula cells with pre-evaluated string contents

Patch created with git diff and packed as tar gz file.
Comment 2 PJ Fanning 2020-07-12 21:26:59 UTC
Could you provide the diff as plain text? I, for one, can't get the binary to download properly.
Comment 3 Bastian Isensee 2020-07-13 17:20:08 UTC
Created attachment 37361 [details]
Plain text patch to quote cell values for formula cells with pre-evaluated string contents

Sure! Added the patch in plain text format.
Comment 4 PJ Fanning 2020-07-13 17:34:56 UTC
Applied with https://github.com/apache/poi/commit/af83fda6b896181da4a28b9ed8b4d8e5ee7242c1 -- thanks