Bug 146877 - Crash when opening file from WebDAV when a WebDAV Property has no namespace
Summary: Crash when opening file from WebDAV when a WebDAV Property has no namespace
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.2.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-20 14:01 UTC by Julian Kalinowski
Modified: 2022-01-21 15:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["webdav_ucp::DAVProperties::createUCBPropName(char const *,char const *,rtl::OUString &)"]


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Kalinowski 2022-01-20 14:01:15 UTC
This bug was filed from the crash reporting server and is br-5af93a6b-be17-485a-8501-31ec14785c59.
=========================================
Crash in in: webdav_ucp::DAVProperties::createUCBPropName(char const *,char const *,rtl::OUString &)

I'm experiencing crashes when opening files using WebDAV from another web-application. The WebDAV server responds with properties that don't have namespaces, LO crashes when trying to convert the null pointer to an OUString in createUCBPropName.

This is a regression, as opening files from the same WebDAV worked in prior versions. I found a change in ustring.hxx that may cause this, but i'm not quite sure: The first OStringToOUString was converted from OString to std::string_view.

The fix is quite easy, but since i'm not sure about where it's best to place the null check, i'm opening this bug report first.
Comment 1 Julien Nabet 2022-01-20 17:32:45 UTC
Michael: since Neon part has been removed and replaced by Curl in master sources, what status to give for these bugs about Neon? (WONTFIX, NEEDINFO and proposing to test dev version, other?)
Comment 2 Xisco Faulí 2022-01-20 18:11:38 UTC
Hello Julian,
Could you please paste the info from Help - about LibreOffice ?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' once the information has been provided
Comment 3 Julian Kalinowski 2022-01-21 14:52:50 UTC
Here is the LO info:

Version: 7.2.5.2 (x64) / LibreOffice Community
Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL

Here's my patch for the crash:
diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
index 575385f5d2d8..fece4506f795 100644
--- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
@@ -98,7 +98,7 @@ void DAVProperties::createUCBPropName( const char * nspace,
                                        OUString & rFullName )
 {
     OUString aNameSpace
-        = OStringToOUString( nspace, RTL_TEXTENCODING_UTF8 );
+        = nspace ? OStringToOUString(nspace, RTL_TEXTENCODING_UTF8) : OUString("");
     OUString aName
         = OStringToOUString( name,   RTL_TEXTENCODING_UTF8 );


Julien: thank you for pointing me to the current master, i tried the current LO 7.4 daily build and can confirm the problem fixed there. Seems that dropping neon for curl improved WebDAV handling in general?

Can we include the simple patch in current branches or do we just wait for 7.4?
Comment 4 Xisco Faulí 2022-01-21 15:08:27 UTC
Julian,
webdav changes in master are also included in LibreOffice 7.3 so it should be fixed there. it will be released as final in a couple of weeks from now, I guess we just have to wait a bit more.
Closing as RESOLVED WORKSFORME since the issue is fixed in master