[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 29 07:52:27 UTC 2021


 sw/source/core/doc/docdesc.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5116370bae6e4e41b0d436e167e03c584146fc91
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon Jun 28 01:31:03 2021 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 29 09:51:54 2021 +0200

    Fix uninitialised conditional jump
    
    Since we just handle one specific case, just initialize the
    variable to something different, instead of checking the
    GetFirstRedoInfo result.
    
    From valgrind:
    
    ==10566== Conditional jump or move depends on uninitialised value(s)
    ==10566==    at 0x270E4451: SwDoc::ChgPageDesc(unsigned long, SwPageDesc const&) (docdesc.cxx:431)
    ==10566==    by 0x272E341F: SwFEShell::ChgPageDesc(unsigned long, SwPageDesc const&) (fedesc.cxx:122)
    ...
    
    Change-Id: Ib95f81297959a535a08dc399f72b68c15e621a27
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118017
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    (cherry picked from commit 3c6b33a3cf982c78b64a1a72bf9b2e7bd07495c3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117982
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 6b63e7a300c3..c51c5cde92ef 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -426,7 +426,7 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged )
     }
     else
     {
-        SwUndoId nBeingUndone;
+        SwUndoId nBeingUndone(SwUndoId::EMPTY);
         GetIDocumentUndoRedo().GetFirstRedoInfo(nullptr, &nBeingUndone);
         if (SwUndoId::HEADER_FOOTER == nBeingUndone)
         {


More information about the Libreoffice-commits mailing list