From 8c9a4ff511a3b1d84a7a6d08a1b153c07f164abb Mon Sep 17 00:00:00 2001 From: Noel Date: Mon, 16 Nov 2020 15:58:10 +0200 Subject: throw exception in SvStream when reading past end of file to avoid chasing weird problems where we read past the end of file, which leads to random data in the variable we read into. I expect a couple of possible regressions from this change (1) memory leaks caused by non-exception-safe memory handling. Of which there should not be much because we're pretty good about using smart pointer classes these days. (2) Broken files which used to load, will no longer do so. These will have to be debugged by putting a breakpoint on the SvStreamEOFException constructor, and examining the backtrace to see where we should be catching and ignoring the exception to make the code continue to handle such broken files. Change-Id: I351be031bb083a3484a9a1b650a58892700e6fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105936 Tested-by: Jenkins Reviewed-by: Noel Grandin --- unotest/source/cpp/filters-test.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unotest') diff --git a/unotest/source/cpp/filters-test.cxx b/unotest/source/cpp/filters-test.cxx index dc6dd5e3c33b..be5ee711b9be 100644 --- a/unotest/source/cpp/filters-test.cxx +++ b/unotest/source/cpp/filters-test.cxx @@ -61,7 +61,7 @@ void FiltersTest::recursiveScan(filterStatus nExpected, { osl::Directory aDir(rURL); - CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, aDir.open()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUString("Failed to open directory " + rURL).toUtf8().getStr(), osl::FileBase::E_None, aDir.open()); osl::DirectoryItem aItem; osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type); std::set dirs; -- cgit