summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-10-19 09:28:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-10-19 14:49:05 +0200
commitbc2fca254f8a9d7ca5eb156b7e3c19756a257e3b (patch)
tree4140069cf46acc88e1ff6c6dd832febff21829f7 /ucb
parent3859878f0e8c4dc212d952a156b83d1ba913f7f1 (diff)
Related: tdf#145169 use of freed pointer in gio create folder
Change-Id: Ia5afdfb545791e143b8d34193de95e30b8f054b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123799 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/gio/gio_content.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index 1e084d638126..debdcf8c4217 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -684,7 +684,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
aEvent.PropertyHandle = -1;
sal_Int32 nChanged = 0, nTitlePos = -1;
- const char *newName = nullptr;
+ OUString aNewTitle;
css::uno::Sequence< css::beans::PropertyChangeEvent > aChanges(nCount);
css::uno::Sequence< css::uno::Any > aRet( nCount );
@@ -704,7 +704,6 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
}
else if ( rValue.Name == "Title" )
{
- OUString aNewTitle;
if (!( rValue.Value >>= aNewTitle ))
{
aRet[ n ] <<= css::beans::IllegalTypeException
@@ -723,7 +722,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
}
OString sNewTitle = OUStringToOString(aNewTitle, RTL_TEXTENCODING_UTF8);
- newName = sNewTitle.getStr();
+ const char *newName = sNewTitle.getStr();
const char *oldName = g_file_info_get_name( pInfo);
if (!newName || !oldName || strcmp(newName, oldName))
@@ -744,7 +743,6 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
{
SAL_WARN("ucb.ucp.gio", "Unknown property " << rValue.Name);
aRet[ n ] <<= getReadOnlyException( static_cast< cppu::OWeakObject * >(this) );
- //TODO
}
}
@@ -764,8 +762,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
{
if (nTitlePos > -1)
{
- OUString aNewURL = getParentURL() +
- OUString( newName, strlen(newName), RTL_TEXTENCODING_UTF8 );
+ OUString aNewURL = getParentURL() + aNewTitle;
css::uno::Reference< css::ucb::XContentIdentifier > xNewId
= new ::ucbhelper::ContentIdentifier( aNewURL );