fpicker/source/office/iodlg.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit a16d2d48db5f6e42736dc861b192eb9057cc5aae
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Jan 13 21:22:38 2025 +0500
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Jan 14 11:02:57 2025 +0100

    tdf#164686: Check filename validity in SvtFileDialog
    
    Handles '|', '<', '>', '"' in the filename.
    
    Change-Id: Ic43bb3b08b1ccd48c691b7ca90f1fc65fed6f320
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180197
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180214

diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 77038e96d500..f1e2132d5c37 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -860,6 +860,13 @@ void SvtFileDialog::OpenHdl_Impl(void const * pVoid)
                         return;
                     }
                 }
+                else if (aFileObj.GetProtocol() == INetProtocol::File)
+                {
+                    // The protocol is 'file', but getSystemPathFromFileURL 
failed -> invalid
+                    // file name (e.g., '|' in the name)
+                    ErrorHandler::HandleError(ERRCODE_IO_INVALIDCHAR);
+                    return;
+                }
             }
         }
         break;

Reply via email to