sc/source/core/data/table2.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit aa6d11771d085803cdb811579f47debc30c4d94b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Feb 7 10:14:31 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Feb 7 22:10:17 2024 +0100

    cid#1559945 rearrange to silence Use after free
    
    try and reassure coverity
    
    Change-Id: I91c08b89d3345b9dcc32696a988906e2db81bb53
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163087
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 6f713ca9f957..fc34eb3b60ea 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1026,6 +1026,8 @@ static void lcl_SetTransposedPatternInRows(ScTable* 
pTransClip, SCROW nAttrRow1,
                                            const std::vector<SCROW>& 
rFilteredRows,
                                            SCROW nRowDestOffset)
 {
+    const CellAttributeHolder aPatternHolder(&rPatternAttr);
+
     for (SCROW nRow = nAttrRow1; nRow <= nAttrRow2; nRow++)
     {
         size_t nFilteredRowAdjustment = 0;
@@ -1046,7 +1048,7 @@ static void lcl_SetTransposedPatternInRows(ScTable* 
pTransClip, SCROW nAttrRow1,
 
         pTransClip->SetPattern(
             static_cast<SCCOL>(nCol1 + nRow - nRow1 - nFilteredRowAdjustment + 
nRowDestOffset),
-            static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), 
rPatternAttr);
+            static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), 
aPatternHolder);
     }
 }
 

Reply via email to