91e94e0
From 00c05a37fa33d20d39a4126ab156de35dc18cafc Mon Sep 17 00:00:00 2001
91e94e0
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
91e94e0
Date: Fri, 12 Apr 2019 15:59:02 +0100
91e94e0
Subject: [PATCH] rhbz#1699347 __glibcxx_requires_subscript enabled in fedora
91e94e0
 release builds
91e94e0
91e94e0
and so triggering a crash and exit on trying to get address of 0th element of a
91e94e0
0 len vector
91e94e0
91e94e0
Change-Id: I205478b6c2878d3758d91812db46fe8ad58e37df
91e94e0
---
91e94e0
 sw/source/filter/ww8/wrtww8.cxx             |  6 +++---
91e94e0
 sw/source/filter/ww8/ww8par3.cxx            |  2 +-
91e94e0
 sw/source/filter/ww8/ww8scan.cxx            |  2 +-
91e94e0
 sw/source/uibase/docvw/edtwin.cxx           |  2 +-
91e94e0
 vcl/source/gdi/pdfwriter_impl.cxx           | 10 ++++-----
91e94e0
 vcl/source/gdi/pdfwriter_impl2.cxx          | 24 ++++++++++-----------
91e94e0
 vcl/source/opengl/OpenGLHelper.cxx          |  6 +++---
91e94e0
 vcl/unx/generic/fontmanager/fontmanager.cxx |  2 +-
91e94e0
 vcl/unx/generic/gdi/gdiimpl.cxx             |  4 ++--
91e94e0
 vcl/unx/generic/print/glyphset.cxx          |  2 +-
91e94e0
 vcl/unx/generic/window/salframe.cxx         |  2 +-
91e94e0
 vcl/unx/gtk/gtksalframe.cxx                 |  4 ++--
91e94e0
 vcl/unx/gtk3/gtk3gtkframe.cxx               |  4 ++--
91e94e0
 13 files changed, 35 insertions(+), 35 deletions(-)
91e94e0
91e94e0
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
91e94e0
index 655716d9e988..607f21aa3350 100644
91e94e0
--- a/sw/source/filter/ww8/wrtww8.cxx
91e94e0
+++ b/sw/source/filter/ww8/wrtww8.cxx
91e94e0
@@ -1774,7 +1774,7 @@ void SwWW8Writer::WriteString16(SvStream& rStrm, const OUString& rStr,
91e94e0
     //vectors are guaranteed to have contiguous memory, so we can do
91e94e0
     //this while migrating away from WW8Bytes. Meyers Effective STL, item 16
91e94e0
     if (!aBytes.empty())
91e94e0
-        rStrm.WriteBytes(&aBytes[0], aBytes.size());
91e94e0
+        rStrm.WriteBytes(aBytes.data(), aBytes.size());
91e94e0
 }
91e94e0
 
91e94e0
 void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool bAddZero)
91e94e0
@@ -1784,7 +1784,7 @@ void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool b
91e94e0
     SwWW8Writer::InsAsString16(aBytes, rStr);
91e94e0
     if (bAddZero)
91e94e0
         SwWW8Writer::InsUInt16(aBytes, 0);
91e94e0
-    rStrm.WriteBytes(&aBytes[0], aBytes.size());
91e94e0
+    rStrm.WriteBytes(aBytes.data(), aBytes.size());
91e94e0
 }
91e94e0
 
91e94e0
 void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
91e94e0
@@ -1797,7 +1797,7 @@ void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
91e94e0
     //vectors are guaranteed to have contiguous memory, so we can do
91e94e0
     ////this while migrating away from WW8Bytes. Meyers Effective STL, item 16
91e94e0
     if (!aBytes.empty())
91e94e0
-        rStrm.WriteBytes(&aBytes[0], aBytes.size());
91e94e0
+        rStrm.WriteBytes(aBytes.data(), aBytes.size());
91e94e0
 }
91e94e0
 
91e94e0
 void WW8Export::WriteStringAsPara( const OUString& rText )
91e94e0
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
91e94e0
index f4b3a886d5ff..c76ed0eea75c 100644
91e94e0
--- a/sw/source/filter/ww8/ww8par3.cxx
91e94e0
+++ b/sw/source/filter/ww8/ww8par3.cxx
91e94e0
@@ -1871,7 +1871,7 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO,
91e94e0
                 {
91e94e0
                     std::unique_ptr<SfxItemSet> xOldCurrentItemSet(SetCurrentItemSet(xListIndent.release()));
91e94e0
 
91e94e0
-                    sal_uInt8* pSprms1  = &aParaSprms[0];
91e94e0
+                    sal_uInt8* pSprms1  = aParaSprms.data();
91e94e0
                     while (0 < nLen)
91e94e0
                     {
91e94e0
                         sal_uInt16 nL1 = ImportSprm(pSprms1, nLen);
91e94e0
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
91e94e0
index 16cc14b4132d..4ba675ce7970 100644
91e94e0
--- a/sw/source/filter/ww8/ww8scan.cxx
91e94e0
+++ b/sw/source/filter/ww8/ww8scan.cxx
91e94e0
@@ -2674,7 +2674,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt,
91e94e0
                         if (aEntry.mnLen)
91e94e0
                         {
91e94e0
                             aEntry.mpData = new sal_uInt8[aEntry.mnLen];
91e94e0
-                            memcpy(aEntry.mpData, &(aSprms[0]), aEntry.mnLen);
91e94e0
+                            memcpy(aEntry.mpData, aSprms.data(), aEntry.mnLen);
91e94e0
                             aEntry.mbMustDelete = true;
91e94e0
                         }
91e94e0
                     }
91e94e0
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
91e94e0
index c892f902fed0..59f62324a535 100644
91e94e0
--- a/sw/source/uibase/docvw/edtwin.cxx
91e94e0
+++ b/sw/source/uibase/docvw/edtwin.cxx
91e94e0
@@ -5895,7 +5895,7 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
91e94e0
         const ExtTextInputAttr nVal = ExtTextInputAttr::DottedUnderline |
91e94e0
                                 ExtTextInputAttr::Highlight;
91e94e0
         const std::vector<ExtTextInputAttr> aAttrs( nL, nVal );
91e94e0
-        CommandExtTextInputData aCETID( sStr, &aAttrs[0], nL,
91e94e0
+        CommandExtTextInputData aCETID( sStr, aAttrs.data(), nL,
91e94e0
                                         0, false );
91e94e0
 
91e94e0
         //fdo#33092. If the current input language is the default
91e94e0
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
91e94e0
index acec33b4ec5c..79662faff35d 100644
91e94e0
--- a/vcl/source/gdi/pdfwriter_impl.cxx
91e94e0
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
91e94e0
@@ -3383,7 +3383,7 @@ bool PDFWriterImpl::emitFonts()
91e94e0
                 sal_Int32 nFontDescriptor = emitFontDescriptor( subset.first, aSubsetInfo, s_subset.m_nFontID, nFontStream );
91e94e0
 
91e94e0
                 if( nToUnicodeStream )
91e94e0
-                    nToUnicodeStream = createToUnicodeCMap( pEncoding, &aCodeUnits[0], pCodeUnitsPerGlyph, pEncToUnicodeIndex, nGlyphs );
91e94e0
+                    nToUnicodeStream = createToUnicodeCMap( pEncoding, aCodeUnits.data(), pCodeUnitsPerGlyph, pEncToUnicodeIndex, nGlyphs );
91e94e0
 
91e94e0
                 sal_Int32 nFontObject = createObject();
91e94e0
                 if ( !updateObject( nFontObject ) ) return false;
91e94e0
@@ -5592,9 +5592,9 @@ sal_Int32 PDFWriterImpl::emitOutputIntent()
91e94e0
     if (!nBytesNeeded)
91e94e0
       return 0;
91e94e0
     std::vector<unsigned char> aBuffer(nBytesNeeded);
91e94e0
-    cmsSaveProfileToMem(hProfile, &aBuffer[0], &nBytesNeeded);
91e94e0
+    cmsSaveProfileToMem(hProfile, aBuffer.data(), &nBytesNeeded);
91e94e0
     cmsCloseProfile(hProfile);
91e94e0
-    bool written = writeBuffer( &aBuffer[0], static_cast<sal_Int32>(aBuffer.size()) );
91e94e0
+    bool written = writeBuffer( aBuffer.data(), static_cast<sal_Int32>(aBuffer.size()) );
91e94e0
     disableStreamEncryption();
91e94e0
     endCompression();
91e94e0
     sal_uInt64 nEndStreamPos = 0;
91e94e0
@@ -5844,9 +5844,9 @@ bool PDFWriterImpl::emitTrailer()
91e94e0
 
91e94e0
             // emit the owner password, must not be encrypted
91e94e0
             aLineS.append( "/O(" );
91e94e0
-            appendLiteralString( reinterpret_cast<char*>(&m_aContext.Encryption.OValue[0]), sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
91e94e0
+            appendLiteralString( reinterpret_cast<char*>(m_aContext.Encryption.OValue.data()), sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
91e94e0
             aLineS.append( ")/U(" );
91e94e0
-            appendLiteralString( reinterpret_cast<char*>(&m_aContext.Encryption.UValue[0]), sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
91e94e0
+            appendLiteralString( reinterpret_cast<char*>(m_aContext.Encryption.UValue.data()), sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
91e94e0
             aLineS.append( ")/P " );// the permission set
91e94e0
             aLineS.append( m_nAccessPermissions );
91e94e0
             aLineS.append( ">>\nendobj\n\n" );
91e94e0
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
91e94e0
index 05f7c5620cf6..ef54cee9c5aa 100644
91e94e0
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
91e94e0
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
91e94e0
@@ -1176,7 +1176,7 @@ void PDFWriterImpl::checkAndEnableStreamEncryption( sal_Int32 nObject )
91e94e0
         // the other location of m_nEncryptionKey is already set to 0, our fixed generation number
91e94e0
         // do the MD5 hash
91e94e0
         ::std::vector<unsigned char> const nMD5Sum(::comphelper::Hash::calculateHash(
91e94e0
-            &m_aContext.Encryption.EncryptionKey[0], i+2, ::comphelper::HashType::MD5));
91e94e0
+            m_aContext.Encryption.EncryptionKey.data(), i+2, ::comphelper::HashType::MD5));
91e94e0
         // the i+2 to take into account the generation number, always zero
91e94e0
         // initialize the RC4 with the key
91e94e0
         // key length: see algorithm 3.1, step 4: (N+5) max 16
91e94e0
@@ -1196,7 +1196,7 @@ void PDFWriterImpl::enableStringEncryption( sal_Int32 nObject )
91e94e0
         // do the MD5 hash
91e94e0
         // the i+2 to take into account the generation number, always zero
91e94e0
         ::std::vector<unsigned char> const nMD5Sum(::comphelper::Hash::calculateHash(
91e94e0
-            &m_aContext.Encryption.EncryptionKey[0], i+2, ::comphelper::HashType::MD5));
91e94e0
+            m_aContext.Encryption.EncryptionKey.data(), i+2, ::comphelper::HashType::MD5));
91e94e0
         // initialize the RC4 with the key
91e94e0
         // key length: see algorithm 3.1, step 4: (N+5) max 16
91e94e0
         rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum.data(), m_nRC4KeyLength, nullptr, 0 );
91e94e0
@@ -1334,7 +1334,7 @@ bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vc
91e94e0
     {
91e94e0
         //step 3
91e94e0
         if( ! io_rProperties.OValue.empty() )
91e94e0
-            pDigest->update(&io_rProperties.OValue[0], io_rProperties.OValue.size());
91e94e0
+            pDigest->update(io_rProperties.OValue.data(), io_rProperties.OValue.size());
91e94e0
         else
91e94e0
             bSuccess = false;
91e94e0
         //Step 4
91e94e0
@@ -1348,7 +1348,7 @@ bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vc
91e94e0
         pDigest->update(nPerm, sizeof(nPerm));
91e94e0
 
91e94e0
         //step 5, get the document ID, binary form
91e94e0
-        pDigest->update(&io_rProperties.DocumentIdentifier[0], io_rProperties.DocumentIdentifier.size());
91e94e0
+        pDigest->update(io_rProperties.DocumentIdentifier.data(), io_rProperties.DocumentIdentifier.size());
91e94e0
         //get the digest
91e94e0
         nMD5Sum = pDigest->finalize();
91e94e0
 
91e94e0
@@ -1416,7 +1416,7 @@ bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPass
91e94e0
         {
91e94e0
             // encrypt the user password using the key set above
91e94e0
             rtl_cipher_encodeARCFOUR( aCipher, i_pPaddedUserPassword, ENCRYPTED_PWD_SIZE, // the data to be encrypted
91e94e0
-                                      &io_rOValue[0], sal_Int32(io_rOValue.size()) ); //encrypted data
91e94e0
+                                      io_rOValue.data(), sal_Int32(io_rOValue.size()) ); //encrypted data
91e94e0
             //Step 7, only if 128 bit
91e94e0
             if( i_nKeyLength == SECUR_128BIT_KEY )
91e94e0
             {
91e94e0
@@ -1435,8 +1435,8 @@ bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPass
91e94e0
                         bSuccess = false;
91e94e0
                         break;
91e94e0
                     }
91e94e0
-                    rtl_cipher_encodeARCFOUR( aCipher, &io_rOValue[0], sal_Int32(io_rOValue.size()), // the data to be encrypted
91e94e0
-                                              &io_rOValue[0], sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
91e94e0
+                    rtl_cipher_encodeARCFOUR( aCipher, io_rOValue.data(), sal_Int32(io_rOValue.size()), // the data to be encrypted
91e94e0
+                                              io_rOValue.data(), sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
91e94e0
                     //step 8, store in class data member
91e94e0
                 }
91e94e0
             }
91e94e0
@@ -1485,14 +1485,14 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
91e94e0
                 io_rProperties.UValue[i] = 0;
91e94e0
             //steps 2 and 3
91e94e0
             aDigest.update(s_nPadString, sizeof(s_nPadString));
91e94e0
-            aDigest.update(&io_rProperties.DocumentIdentifier[0], io_rProperties.DocumentIdentifier.size());
91e94e0
+            aDigest.update(io_rProperties.DocumentIdentifier.data(), io_rProperties.DocumentIdentifier.size());
91e94e0
 
91e94e0
             ::std::vector<unsigned char> const nMD5Sum(aDigest.finalize());
91e94e0
             //Step 4
91e94e0
             rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
91e94e0
-                                    &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, nullptr, 0 ); //destination data area
91e94e0
+                                    io_rProperties.EncryptionKey.data(), SECUR_128BIT_KEY, nullptr, 0 ); //destination data area
91e94e0
             rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum.data(), nMD5Sum.size(), // the data to be encrypted
91e94e0
-                                      &io_rProperties.UValue[0], SECUR_128BIT_KEY ); //encrypted data, stored in class data member
91e94e0
+                                      io_rProperties.UValue.data(), SECUR_128BIT_KEY ); //encrypted data, stored in class data member
91e94e0
             //step 5
91e94e0
             sal_uInt32 i, y;
91e94e0
             sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
91e94e0
@@ -1505,8 +1505,8 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
91e94e0
                 rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
91e94e0
                                         nLocalKey, SECUR_128BIT_KEY, // key and key length
91e94e0
                                         nullptr, 0 ); //destination data area, on init can be NULL
91e94e0
-                rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted
91e94e0
-                                          &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
91e94e0
+                rtl_cipher_encodeARCFOUR( aCipher, io_rProperties.UValue.data(), SECUR_128BIT_KEY, // the data to be encrypted
91e94e0
+                                          io_rProperties.UValue.data(), SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
91e94e0
             }
91e94e0
         }
91e94e0
         else
91e94e0
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
91e94e0
index 3bad4ea44b87..8d4f9cdd5b22 100644
91e94e0
--- a/vcl/source/opengl/OpenGLHelper.cxx
91e94e0
+++ b/vcl/source/opengl/OpenGLHelper.cxx
91e94e0
@@ -123,13 +123,13 @@ namespace {
91e94e0
         {
91e94e0
             std::vector<char> ErrorMessage(InfoLogLength+1);
91e94e0
             if (bShaderNotProgram)
91e94e0
-                glGetShaderInfoLog (nId, InfoLogLength, nullptr, &ErrorMessage[0]);
91e94e0
+                glGetShaderInfoLog (nId, InfoLogLength, nullptr, ErrorMessage.data());
91e94e0
             else
91e94e0
-                glGetProgramInfoLog(nId, InfoLogLength, nullptr, &ErrorMessage[0]);
91e94e0
+                glGetProgramInfoLog(nId, InfoLogLength, nullptr, ErrorMessage.data());
91e94e0
             CHECK_GL_ERROR();
91e94e0
 
91e94e0
             ErrorMessage.push_back('\0');
91e94e0
-            SAL_WARN("vcl.opengl", rDetail << " shader " << nId << " compile for " << rName << " failed : " << &ErrorMessage[0]);
91e94e0
+            SAL_WARN("vcl.opengl", rDetail << " shader " << nId << " compile for " << rName << " failed : " << ErrorMessage.data());
91e94e0
         }
91e94e0
         else
91e94e0
             SAL_WARN("vcl.opengl", rDetail << " shader: " << rName << " compile " << nId << " failed without error log");
91e94e0
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
91e94e0
index 390158e48cf8..86d643ab2e04 100644
91e94e0
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
91e94e0
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
91e94e0
@@ -1127,7 +1127,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
91e94e0
         for (int i = 0; i < nGlyphs; i++)
91e94e0
             aGlyphIds[i] = sal_uInt16(i);
91e94e0
         TTSimpleGlyphMetrics* pMetrics = GetTTSimpleGlyphMetrics(pTTFont,
91e94e0
-                                                                 &aGlyphIds[0],
91e94e0
+                                                                 aGlyphIds.data(),
91e94e0
                                                                  nGlyphs,
91e94e0
                                                                  bVertical);
91e94e0
         if (pMetrics)
91e94e0
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
91e94e0
index b815992e2d4d..a6d15d192db1 100644
91e94e0
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
91e94e0
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
91e94e0
@@ -1481,7 +1481,7 @@ bool X11SalGraphicsImpl::drawPolyPolygon( const basegfx::B2DPolyPolygon& rOrigPo
91e94e0
     const int nTrapCount = aB2DTrapVector.size();
91e94e0
     if( !nTrapCount )
91e94e0
         return true;
91e94e0
-    const bool bDrawn = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
91e94e0
+    const bool bDrawn = drawFilledTrapezoids( aB2DTrapVector.data(), nTrapCount, fTransparency );
91e94e0
     return bDrawn;
91e94e0
 }
91e94e0
 
91e94e0
@@ -1557,7 +1557,7 @@ bool X11SalGraphicsImpl::drawFilledTrapezoids( const basegfx::B2DTrapezoid* pB2D
91e94e0
     // render the trapezoids
91e94e0
     const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
91e94e0
     rRenderPeer.CompositeTrapezoids( PictOpOver,
91e94e0
-        rEntry.m_aPicture, aDstPic, pMaskFormat, 0, 0, &aTrapVector[0], aTrapVector.size() );
91e94e0
+        rEntry.m_aPicture, aDstPic, pMaskFormat, 0, 0, aTrapVector.data(), aTrapVector.size() );
91e94e0
 
91e94e0
     return true;
91e94e0
 }
91e94e0
diff --git a/vcl/unx/generic/print/glyphset.cxx b/vcl/unx/generic/print/glyphset.cxx
91e94e0
index e019049f5d4e..37e7924f117d 100644
91e94e0
--- a/vcl/unx/generic/print/glyphset.cxx
91e94e0
+++ b/vcl/unx/generic/print/glyphset.cxx
91e94e0
@@ -235,7 +235,7 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
91e94e0
     aInfo.LoadFont( pSrcFont );
91e94e0
 
91e94e0
     aInfo.CreateFontSubset( nTargetMask, pTmpFile, pGlyphSetName,
91e94e0
-        &aRequestedGlyphs[0], &aEncoding[0], nGlyphCount );
91e94e0
+        &aRequestedGlyphs[0], aEncoding.data(), nGlyphCount );
91e94e0
 }
91e94e0
 
91e94e0
 void
91e94e0
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
91e94e0
index 88a9c455cbb1..845fcd573105 100644
91e94e0
--- a/vcl/unx/generic/window/salframe.cxx
91e94e0
+++ b/vcl/unx/generic/window/salframe.cxx
91e94e0
@@ -2928,7 +2928,7 @@ bool X11SalFrame::appendUnicodeSequence( sal_Unicode c )
91e94e0
 
91e94e0
             SalExtTextInputEvent aEv;
91e94e0
             aEv.maText          = rSeq;
91e94e0
-            aEv.mpTextAttr      = &attribs[0];
91e94e0
+            aEv.mpTextAttr      = attribs.data();
91e94e0
             aEv.mnCursorPos     = 0;
91e94e0
             aEv.mnCursorFlags   = 0;
91e94e0
 
91e94e0
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
91e94e0
index 56cb33520443..9d5fd0aced77 100644
91e94e0
--- a/vcl/unx/gtk/gtksalframe.cxx
91e94e0
+++ b/vcl/unx/gtk/gtksalframe.cxx
91e94e0
@@ -3293,7 +3293,7 @@ void GtkSalFrame::IMHandler::endExtTextInput( EndExtTextInputFlags /*nFlags*/ )
91e94e0
         if( ! aDel.isDeleted() )
91e94e0
         {
91e94e0
             // mark previous preedit state again (will e.g. be sent at focus gain)
91e94e0
-            m_aInputEvent.mpTextAttr = &m_aInputFlags[0];
91e94e0
+            m_aInputEvent.mpTextAttr = m_aInputFlags.data();
91e94e0
             if( m_bFocused )
91e94e0
             {
91e94e0
                 // begin preedit again
91e94e0
@@ -3614,7 +3614,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
91e94e0
     } while (pango_attr_iterator_next (iter));
91e94e0
     pango_attr_iterator_destroy(iter);
91e94e0
 
91e94e0
-    pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0];
91e94e0
+    pThis->m_aInputEvent.mpTextAttr = pThis->m_aInputFlags.data();
91e94e0
 
91e94e0
     g_free( pText );
91e94e0
     pango_attr_list_unref( pAttrs );
91e94e0
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
91e94e0
index 95e616473608..538ceafcd3a8 100644
91e94e0
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
91e94e0
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
91e94e0
@@ -3849,7 +3849,7 @@ void GtkSalFrame::IMHandler::endExtTextInput( EndExtTextInputFlags /*nFlags*/ )
91e94e0
         if( ! aDel.isDeleted() )
91e94e0
         {
91e94e0
             // mark previous preedit state again (will e.g. be sent at focus gain)
91e94e0
-            m_aInputEvent.mpTextAttr = &m_aInputFlags[0];
91e94e0
+            m_aInputEvent.mpTextAttr = m_aInputFlags.data();
91e94e0
             if( m_bFocused )
91e94e0
             {
91e94e0
                 // begin preedit again
91e94e0
@@ -4161,7 +4161,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
91e94e0
     } while (pango_attr_iterator_next (iter));
91e94e0
     pango_attr_iterator_destroy(iter);
91e94e0
 
91e94e0
-    pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0];
91e94e0
+    pThis->m_aInputEvent.mpTextAttr = pThis->m_aInputFlags.data();
91e94e0
 
91e94e0
     g_free( pText );
91e94e0
     pango_attr_list_unref( pAttrs );
91e94e0
-- 
91e94e0
2.21.0
91e94e0