Bug 60063

Summary: FILEOPEN particular .docx fails with error message "General Error"
Product: LibreOffice Reporter: Oliver Maier <oliver.maier2001>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: cedric.bosdonnat.ooo, LibreOffice, michael.stahl, serval2412
Priority: medium    
Version: 3.6.5.2 release   
Hardware: x86 (IA32)   
OS: Windows (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: It is a master thesis
bt + console logs on master

Description Oliver Maier 2013-01-30 09:12:53 UTC
Created attachment 73912 [details]
It is a master thesis

Cannot open this docx-file.
Comment 1 Rainer Bielefeld Retired 2013-01-30 10:31:45 UTC
[Reproducible] with "LibO  4.0.0.2 rc   -  GERMAN UI / German Locale  [Build ID: 5991f37846fc3763493029c4958b57282c2597e)]"  {tinderbox: @6, pull time 2013-01-24  07:20(?)} on German WIN7 Home Premium (64bit) with User Profile automatically created form renamed /3 User profile used by 3.6.5.2.

Sample document seems to be sane, opens fine with MS WORD Viewer.

Already [Reproducible] with "LibO  4.0.0.2 rc   -  GERMAN UI / German Locale  [Build ID: 5991f37846fc3763493029c4958b57282c2597e)]"  {tinderbox: @6, pull time 2013-01-24  07:20(?)} on German WIN7 Home Premium (64bit) with User Profile automatically created form renamed /3 User profile used by 3.6.5.2:
"General Error. General input/output error"

Crashes with LibO 3.3.3 3.5.2,
Comment 2 Julien Nabet 2013-02-07 22:58:10 UTC
Created attachment 74388 [details]
bt + console logs on master

On pc Debian x86-64 with master sources updated today, I reproduced the crash.

Attached console logs + bt
Comment 3 Julien Nabet 2013-02-07 23:04:43 UTC
Here are 2 possible patches:

1)
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx
index 1067315..6c01d4c 100644
--- a/oox/source/docprop/docprophandler.cxx
+++ b/oox/source/docprop/docprophandler.cxx
@@ -174,9 +174,9 @@ uno::Sequence< ::rtl::OUString > OOXMLDocPropHandler::GetKeywordsSet( const ::rt
                     // unfortunately I did not find any specification for the possible delimiters
                     if ( !aResult[nCounter].isEmpty() )
                     {
-                        if ( nCounter >= aResult.getLength() )
-                            aResult.realloc( nCounter + 10 );
                         nCounter++;
+                        if ( nCounter >= aResult.getLength())
+                            aResult.realloc( nCounter + 10 );

2)
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx
index 1067315..b96ed6b 100644
--- a/oox/source/docprop/docprophandler.cxx
+++ b/oox/source/docprop/docprophandler.cxx
@@ -174,7 +174,7 @@ uno::Sequence< ::rtl::OUString > OOXMLDocPropHandler::GetKeywordsSet( const ::rt
                     // unfortunately I did not find any specification for the possible delimiters
                     if ( !aResult[nCounter].isEmpty() )
                     {
-                        if ( nCounter >= aResult.getLength() )
+                        if ( nCounter >= (aResult.getLength() - 1) )
                             aResult.realloc( nCounter + 10 );
                         nCounter++;
                     }

Both work but I'm not sure if one is wrong or if they're equivalent.

Michael/Cédric: one for you?
If one of them is ok, tell me, I can push the patch on master.
Comment 4 Elton Chung 2013-04-26 19:14:08 UTC
(In reply to comment #3)

Just saw this bug on the crashlog of automatic crash testing.
What about posting the patch to gerrit for review?
Comment 5 Mike Kaganski 2013-09-23 05:29:44 UTC
Opens fine with 4.1.1.2 under Win7x64. WORKSFORME.