summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-08-16 21:46:44 +0200
committerCaolán McNamara <caolanm@redhat.com>2021-08-17 10:51:59 +0200
commitd6808f6ba03f74f99759e8d59ac0a04fcc9c6dd8 (patch)
tree75183d0c5fcddebbfb5d9a46e5507c602f51d122
parenttdf#143860 non-primitive needs custGeom not prstGeom (diff)
downloadcore-d6808f6ba03f74f99759e8d59ac0a04fcc9c6dd8.tar.gz
core-d6808f6ba03f74f99759e8d59ac0a04fcc9c6dd8.zip
Resolves: tdf#96561 Include embedded null-characters while assembling CSV line
... instead of prematurely ending analysis and skipping the remainder that is still part of data read. Change-Id: I8f34bc9672e37f9c1c1ae81ddeba464360add7c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120555 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 7bd03074ae7362d8fffe5182529626a0b43a0ed1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120451 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/docshell/impex.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 380bd875fadc..6297fba3a1a7 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2515,8 +2515,17 @@ Label_RetryWithNewSep:
while (!rStream.eof() && aStr.getLength() < nArbitraryLineLengthLimit)
{
const sal_Unicode * p = aStr.getStr() + nLastOffset;
- while (*p)
+ const sal_Unicode * const pStop = aStr.getStr() + aStr.getLength();
+ while (p < pStop)
{
+ if (!*p)
+ {
+ // Skip embedded null-characters. They don't change
+ // anything and are handled at a higher level.
+ ++p;
+ continue;
+ }
+
if (nQuotes)
{
if (*p == cFieldQuote)