sc/source/core/data/column3.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit e49f965e6e0ae7f643ecc012c0fffce02a9cef29
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Apr 24 09:37:35 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Apr 29 18:30:26 2024 +0200

    sc: fix crash in ScColumn::SetEditText()
    
    Crashreport:
    
    > SIG   Fatal signal received: SIGSEGV code: 128 for address: 0x0
    > program/libsclo.so
    >       ScColumn::SetEditText(int, std::unique_ptr<EditTextObject, 
std::default_delete<EditTextObject> >)
    >               sc/source/core/data/column3.cxx:2362
    > program/libsclo.so
    >       ScTable::SetEditText(short, int, std::unique_ptr<EditTextObject, 
std::default_delete<EditTextObject> >)
    >               
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
    > program/libsclo.so
    >       ScDocument::SetEditText(ScAddress const&, 
std::unique_ptr<EditTextObject, std::default_delete<EditTextObject> >)
    >               
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
    > program/libsclo.so
    >       ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, 
bool)
    >               
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
    > program/libsclo.so
    >       (anonymous 
namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous 
namespace)::FormulaProcessingContext>)
    >               sc/source/ui/view/viewfunc.cxx:565
    
    Change-Id: I331ca8784702fdcb0ebad6a0a73390dbe2615ece
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166612
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    (cherry picked from commit e3ce4aad47c052dcd67107f7c91336f4ecc949be)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166525
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f0f4cc83263b..5a1582e560d7 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2358,6 +2358,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const 
OUString& rString,
 
 void ScColumn::SetEditText( SCROW nRow, std::unique_ptr<EditTextObject> 
pEditText )
 {
+    if (!pEditText)
+    {
+        return;
+    }
+
     pEditText->NormalizeString(GetDoc().GetSharedStringPool());
     std::vector<SCROW> aNewSharedRows;
     sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, 
false);

Reply via email to