emfio/source/reader/emfreader.cxx |    5 +++++
 sw/source/filter/xml/xmlimp.cxx   |    2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 975590e69edfa351ef20a0973a5005ca49d08edc
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat May 13 17:22:48 2023 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat May 13 21:05:26 2023 +0200

    Related: ofz#58942 use the same flags as filterdetect.cxx
    
    Change-Id: Ifd53334bc17a77dbf37f06d043fe0a8038fa63b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151729
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 2e7f634212f5..a4e4bbc266d9 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1779,7 +1779,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool 
TestPDFExportFODT(SvStream &rStream)
     OString const str(read_uInt8s_ToOString(rStream, 4000));
     rStream.Seek(STREAM_SEEK_TO_BEGIN);
     OUString resultString(str.getStr(), str.getLength(), 
RTL_TEXTENCODING_ASCII_US,
-                          
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT|OSTRING_TO_OUSTRING_CVTFLAGS);
+                          
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT|RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT|RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT);
     if 
(resultString.indexOf("office:mimetype=\"application/vnd.oasis.opendocument.text\"")
 == -1)
         return false;
 
commit 16941a925c38022a8ab07088d2e42e0b9aa44b78
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat May 13 17:08:29 2023 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat May 13 21:05:16 2023 +0200

    ofz#58928 Heap-buffer-overflow READ
    
    since:
    
    commit ba0bf0ab2c24d309e8a938cec26daa41eba9c8cf
    Date:   Mon Mar 21 20:20:02 2022 +0100
    
        tdf#142249 EMF Implement EMR_POLYDRAW record
    
    Change-Id: I9234a66d9f8691b9b051950b818884429b5f7277
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151728
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index ceb797f568b0..dcb8a2379148 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1009,6 +1009,11 @@ namespace emfio
                             }
                             else if (aPointTypes[i] & PT_BEZIERTO)
                             {
+                                if (aPoints.size() - i < 3)
+                                {
+                                    SAL_WARN("emfio", "EMF file error: Not 
enough Bezier points.");
+                                    break;
+                                }
                                 tools::Polygon aPolygon(4);
                                 aPolygon[0] = maActPos;
                                 aPolygon[1] = aPoints[i++];

Reply via email to