sw/source/ui/dbui/mmgreetingspage.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 014612657286b8042580245773934c5a9433503b
Author:     Mike Kaganski <[email protected]>
AuthorDate: Mon Oct 6 20:52:26 2025 +0200
Commit:     Mike Kaganski <[email protected]>
CommitDate: Mon Oct 6 22:13:19 2025 +0200

    tdf#168723: realloc should create the _correct_ size before access ;-)
    
    This is how commit 36df0b837b398f1011cb6f9fdf978a24125eee89 (INTEGRATION:
    CWS os47 (1.3.190); FILE MERGED, 2005-01-28) desctibed the same change
    in commitPage. The leftover's time came, just after 20 years.
    
    Change-Id: Id960f84349b8885811ad750d5956965d0ccf47b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191981
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx 
b/sw/source/ui/dbui/mmgreetingspage.cxx
index 3e5f8d43c243..48308ea2d56a 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -403,8 +403,8 @@ IMPL_LINK_NOARG(SwMailBodyDialog, OKHdl, weld::Button&, 
void)
         const SwDBData& rDBData = m_rConfigItem.GetCurrentDBData();
         Sequence< OUString> aAssignment = m_rConfigItem.GetColumnAssignment( 
rDBData );
         sal_Int32 nPos = m_xFemaleColumnLB->get_active();
-        if(aAssignment.getLength() < MM_PART_GENDER)
-            aAssignment.realloc(MM_PART_GENDER);
+        if(aAssignment.getLength() <= MM_PART_GENDER)
+            aAssignment.realloc(MM_PART_GENDER + 1);
         if( nPos > 0 )
             aAssignment.getArray()[MM_PART_GENDER] = 
m_xFemaleColumnLB->get_active_text();
         else

Reply via email to