filter/CppunitTest_filter_eps_test.mk | 45 + filter/Module_filter.mk | 1 filter/qa/cppunit/data/eps/fail/CVE-2009-4195-1.eps |binary filter/qa/cppunit/data/eps/indeterminate/.gitignore | 1 filter/qa/cppunit/data/eps/pass/CVE-2013-4979-1.eps |binary filter/qa/cppunit/data/eps/pass/fdo13433-4.eps | 667 ++++++++++++++++++++ filter/qa/cppunit/filters-eps-test.cxx | 71 ++ filter/source/msfilter/escherex.cxx | 4 filter/source/msfilter/svdfppt.cxx | 5 forms/source/component/DatabaseForm.cxx | 18 forms/source/component/FormComponent.cxx | 12 include/filter/msfilter/svdfppt.hxx | 2 sd/source/filter/ppt/pptinanimations.cxx | 2 svx/source/svdraw/svdoashp.cxx | 3 svx/source/xoutdev/_xoutbmp.cxx | 7 vcl/source/filter/wmf/winwmf.cxx | 64 + xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 2 17 files changed, 877 insertions(+), 27 deletions(-)
New commits: commit 87118d5adf92124450ba688f2643cc9447304976 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 10:45:44 2014 +0100 coverity#735638 Division or modulo by float zero Change-Id: I2f183bc0bb9c67e3873e13a4bdbc57be9471b8a3 diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 021e9a0..3f8b1fd 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2484,7 +2484,8 @@ Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, const bool Rectangle aAdjustedTextRect( aNewTextRect ); // <- new text rectangle is being tested by AdjustTextFrameWidthAndHeight to ensure if ( AdjustTextFrameWidthAndHeight( aAdjustedTextRect, bHgt, bWdt ) ) // that the new text rectangle is matching the current text size from the outliner { - if ( ( aAdjustedTextRect != aNewTextRect ) && ( aOldTextRect != aAdjustedTextRect ) ) + if (aAdjustedTextRect != aNewTextRect && aOldTextRect != aAdjustedTextRect && + aNewTextRect.GetWidth() && aNewTextRect.GetHeight()) { aReturnValue = aRect; double fXScale = (double)aOldTextRect.GetWidth() / (double)aNewTextRect.GetWidth(); commit 90fbb7086c711dbb21770f5d364bdb0abc909573 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 10:43:44 2014 +0100 coverity#735639 Division or modulo by float zero Change-Id: I2ba45c49fb00fdd53b8e388e25df503e82c2332e diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index da0ca01..0a16759 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -494,11 +494,12 @@ Polygon XOutBitmap::GetCountour( const Bitmap& rBmp, const sal_uIntPtr nFlags, BitmapReadAccess* pAcc = aWorkBmp.AcquireReadAccess(); - if( pAcc ) + const long nWidth = pAcc ? pAcc->Width() : 0; + const long nHeight = pAcc ? pAcc->Height() : 0; + + if (pAcc && nWidth && nHeight) { const Size& rPrefSize = aWorkBmp.GetPrefSize(); - const long nWidth = pAcc->Width(); - const long nHeight = pAcc->Height(); const double fFactorX = (double) rPrefSize.Width() / nWidth; const double fFactorY = (double) rPrefSize.Height() / nHeight; const long nStartX1 = aWorkRect.Left() + 1L; commit 366c658c77d02fd8d82116ca49640ee87c92f933 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 09:46:01 2014 +0100 add CVE-2013-4979 test Change-Id: I54025f46394ec1b16443ba75ff9edf9d8e1f6738 diff --git a/filter/qa/cppunit/data/eps/pass/CVE-2013-4979-1.eps b/filter/qa/cppunit/data/eps/pass/CVE-2013-4979-1.eps new file mode 100644 index 0000000..ae6c6aa Binary files /dev/null and b/filter/qa/cppunit/data/eps/pass/CVE-2013-4979-1.eps differ commit 069485673730ec003f53e2fc9697ee29732f8ba6 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 09:33:49 2014 +0100 add eps import regression test Change-Id: Iba88c7e54ba83132a859124d51f88be72cb3e3e1 diff --git a/filter/CppunitTest_filter_eps_test.mk b/filter/CppunitTest_filter_eps_test.mk new file mode 100644 index 0000000..89d1102 --- /dev/null +++ b/filter/CppunitTest_filter_eps_test.mk @@ -0,0 +1,45 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,filter_eps_test)) + +$(eval $(call gb_CppunitTest_use_external,filter_eps_test,boost_headers)) + +$(eval $(call gb_CppunitTest_add_exception_objects,filter_eps_test, \ + filter/qa/cppunit/filters-eps-test \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,filter_eps_test, \ + ips \ + sal \ + test \ + tl \ + unotest \ + vcl \ + $(gb_UWINAPI) \ +)) + +$(eval $(call gb_CppunitTest_use_api,filter_eps_test,\ + udkapi \ + offapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,filter_eps_test)) +$(eval $(call gb_CppunitTest_use_vcl,filter_eps_test)) + +$(eval $(call gb_CppunitTest_use_components,filter_eps_test,\ + configmgr/source/configmgr \ + i18npool/util/i18npool \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,filter_eps_test)) + +# vim: set noet sw=4 ts=4: diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk index a3bddf4..7c7575a 100644 --- a/filter/Module_filter.mk +++ b/filter/Module_filter.mk @@ -86,6 +86,7 @@ $(eval $(call gb_Module_add_check_targets,filter,\ ifneq ($(DISABLE_CVE_TESTS),TRUE) $(eval $(call gb_Module_add_check_targets,filter,\ CppunitTest_filter_dxf_test \ + CppunitTest_filter_eps_test \ CppunitTest_filter_met_test \ CppunitTest_filter_pcx_test \ CppunitTest_filter_pict_test \ diff --git a/filter/qa/cppunit/data/eps/fail/.gitignore b/filter/qa/cppunit/data/eps/fail/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/filter/qa/cppunit/data/eps/fail/CVE-2009-4195-1.eps b/filter/qa/cppunit/data/eps/fail/CVE-2009-4195-1.eps new file mode 100644 index 0000000..5ae189f Binary files /dev/null and b/filter/qa/cppunit/data/eps/fail/CVE-2009-4195-1.eps differ diff --git a/filter/qa/cppunit/data/eps/indeterminate/.gitignore b/filter/qa/cppunit/data/eps/indeterminate/.gitignore new file mode 100644 index 0000000..583b009c --- /dev/null +++ b/filter/qa/cppunit/data/eps/indeterminate/.gitignore @@ -0,0 +1 @@ +*.wmf-* diff --git a/filter/qa/cppunit/data/eps/pass/.gitignore b/filter/qa/cppunit/data/eps/pass/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/filter/qa/cppunit/data/eps/pass/fdo13433-4.eps b/filter/qa/cppunit/data/eps/pass/fdo13433-4.eps new file mode 100644 index 0000000..6ca427f --- /dev/null +++ b/filter/qa/cppunit/data/eps/pass/fdo13433-4.eps @@ -0,0 +1,667 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: /home/amg/newtest05.eps +%%Creator: matplotlib version 0.98.0, http://matplotlib.sourceforge.net/ +%%CreationDate: Sat Jul 19 09:49:37 2008 +%%Orientation: portrait +%%BoundingBox: 13 175 598 616 +%%EndComments +%%BeginProlog +/mpldict 7 dict def +mpldict begin +/m { moveto } bind def +/l { lineto } bind def +/r { rlineto } bind def +/c { curveto } bind def +/cl { closepath } bind def +/box { +m +1 index 0 r +0 exch r +neg 0 r +cl +} bind def +/clipbox { +box +clip +newpath +} bind def +end +%%EndProlog +mpldict begin +13.5 175.5 translate +585 441 0 0 clipbox +1.000 setlinewidth +0 setlinejoin +2 setlinecap +[] 0 setdash +1.000 setgray +gsave +0 0 m +585 0 l +585 441 l +0 441 l +0 0 l +gsave +fill +grestore +stroke +grestore +0.000 setgray +gsave +73.125 44.1 m +526.5 44.1 l +526.5 396.9 l +73.125 396.9 l +73.125 44.1 l +gsave +1.000 setgray +fill +grestore +stroke +grestore +0.500 setlinewidth +0 setlinecap +gsave +453.4 352.8 73.12 44.1 clipbox +/o { +gsave +newpath +translate +0 -3 m +0.795609 -3 1.55874 -2.6839 2.12132 -2.12132 c +2.6839 -1.55874 3 -0.795609 3 0 c +3 0.795609 2.6839 1.55874 2.12132 2.12132 c +1.55874 2.6839 0.795609 3 0 3 c +-0.795609 3 -1.55874 2.6839 -2.12132 2.12132 c +-2.6839 1.55874 -3 0.795609 -3 0 c +-3 -0.795609 -2.6839 -1.55874 -2.12132 -2.12132 c +-1.55874 -2.6839 -0.795609 -3 0 -3 c +cl +gsave +1.000 0.000 0.000 setrgbcolor +fill +grestore +stroke +grestore +} bind def +73.1 92.5 o +77.7 206 o +82.2 204 o +86.7 293 o +91.3 189 o +95.8 276 o +100 250 o +105 226 o +109 240 o +114 329 o +118 250 o +123 226 o +128 99 o +132 195 o +137 241 o +141 168 o +146 166 o +150 301 o +155 294 o +159 223 o +164 220 o +168 184 o +173 205 o +177 242 o +182 320 o +186 239 o +191 306 o +196 272 o +200 96.1 o +205 293 o +209 265 o +214 233 o +218 231 o +223 138 o +227 204 o +232 278 o +236 271 o +241 165 o +245 199 o +250 239 o +254 234 o +259 306 o +264 304 o +268 246 o +273 172 o +277 180 o +282 246 o +286 146 o +291 97.8 o +295 241 o +300 141 o +304 242 o +309 177 o +313 189 o +318 142 o +322 216 o +327 273 o +332 261 o +336 173 o +341 223 o +345 282 o +350 285 o +354 90.1 o +359 241 o +363 344 o +368 187 o +372 172 o +377 224 o +381 300 o +386 237 o +390 107 o +395 249 o +400 263 o +404 146 o +409 162 o +413 228 o +418 252 o +422 166 o +427 255 o +431 92.7 o +436 277 o +440 204 o +445 226 o +449 356 o +454 277 o +458 247 o +463 244 o +468 272 o +472 286 o +477 259 o +481 332 o +486 138 o +490 212 o +495 203 o +499 163 o +504 374 o +508 371 o +513 223 o +517 126 o +522 205 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +0 4 l +stroke +grestore +} bind def +73.1 44.1 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +0 -4 l +stroke +grestore +} bind def +73.1 397 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +70.389000 31.664000 translate +0.000000 rotate +0.000000 0.000000 m /zero glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +0 4 l +stroke +grestore +} bind def +164 44.1 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +0 -4 l +stroke +grestore +} bind def +164 397 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +158.328000 31.436000 translate +0.000000 rotate +0.000000 0.000000 m /two glyphshow +5.472000 0.000000 m /zero glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +0 4 l +stroke +grestore +} bind def +254 44.1 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +0 -4 l +stroke +grestore +} bind def +254 397 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +249.003000 31.436000 translate +0.000000 rotate +0.000000 0.000000 m /four glyphshow +5.472000 0.000000 m /zero glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +0 4 l +stroke +grestore +} bind def +345 44.1 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +0 -4 l +stroke +grestore +} bind def +345 397 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +339.678000 31.664000 translate +0.000000 rotate +0.000000 0.000000 m /six glyphshow +5.472000 0.000000 m /zero glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +0 4 l +stroke +grestore +} bind def +436 44.1 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +0 -4 l +stroke +grestore +} bind def +436 397 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +430.353000 31.664000 translate +0.000000 rotate +0.000000 0.000000 m /eight glyphshow +5.472000 0.000000 m /zero glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +0 4 l +stroke +grestore +} bind def +526 44.1 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +0 -4 l +stroke +grestore +} bind def +526 397 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +518.292000 31.436000 translate +0.000000 rotate +0.000000 0.000000 m /one glyphshow +5.472000 0.000000 m /zero glyphshow +10.944000 0.000000 m /zero glyphshow +grestore + 1.000 setlinewidth +gsave +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +296.531 17.82 moveto +0.0 rotate +(X) +0.000 0.000 0.000 setrgbcolor +show +grestore +stroke +grestore +0.500 setlinewidth +gsave +/o { +gsave +newpath +translate +0 0 m +4 0 l +stroke +grestore +} bind def +73.1 44.1 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +-4 0 l +stroke +grestore +} bind def +526 44.1 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +57.905000 39.882000 translate +0.000000 rotate +0.000000 0.000000 m /minus glyphshow +5.748000 0.000000 m /three glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +4 0 l +stroke +grestore +} bind def +73.1 103 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +-4 0 l +stroke +grestore +} bind def +526 103 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +57.905000 98.682000 translate +0.000000 rotate +0.000000 0.000000 m /minus glyphshow +5.748000 0.000000 m /two glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +4 0 l +stroke +grestore +} bind def +73.1 162 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +-4 0 l +stroke +grestore +} bind def +526 162 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +57.905000 157.482000 translate +0.000000 rotate +0.000000 0.000000 m /minus glyphshow +5.748000 0.000000 m /one glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +4 0 l +stroke +grestore +} bind def +73.1 221 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +-4 0 l +stroke +grestore +} bind def +526 221 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +63.653000 216.282000 translate +0.000000 rotate +0.000000 0.000000 m /zero glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +4 0 l +stroke +grestore +} bind def +73.1 279 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +-4 0 l +stroke +grestore +} bind def +526 279 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +63.653000 275.082000 translate +0.000000 rotate +0.000000 0.000000 m /one glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +4 0 l +stroke +grestore +} bind def +73.1 338 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +-4 0 l +stroke +grestore +} bind def +526 338 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +63.653000 333.882000 translate +0.000000 rotate +0.000000 0.000000 m /two glyphshow +grestore + gsave +/o { +gsave +newpath +translate +0 0 m +4 0 l +stroke +grestore +} bind def +73.1 397 o +grestore +gsave +/o { +gsave +newpath +translate +0 0 m +-4 0 l +stroke +grestore +} bind def +526 397 o +grestore +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +63.653000 392.682000 translate +0.000000 rotate +0.000000 0.000000 m /three glyphshow +grestore + 1.000 setlinewidth +gsave +gsave +/Helvetica-Narrow findfont +12.0 scalefont +setfont +52.905 217.218 moveto +90.0 rotate +(Y) +0.000 0.000 0.000 setrgbcolor +show +grestore +stroke +grestore +2 setlinecap +gsave +73.125 44.1 m +526.5 44.1 l +526.5 396.9 l +73.125 396.9 l +73.125 44.1 l +stroke +grestore +0 setlinecap +gsave +gsave +/Helvetica-Narrow findfont +14.0 scalefont +setfont +277.798 404.798 moveto +0.0 rotate +(Test plot) +0.000 0.000 0.000 setrgbcolor +show +grestore +stroke +grestore + +end +showpage diff --git a/filter/qa/cppunit/filters-eps-test.cxx b/filter/qa/cppunit/filters-eps-test.cxx new file mode 100644 index 0000000..f291d11 --- /dev/null +++ b/filter/qa/cppunit/filters-eps-test.cxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <unotest/filters-test.hxx> +#include <test/bootstrapfixture.hxx> +#include <vcl/FilterConfigItem.hxx> +#include <tools/stream.hxx> +#include <vcl/graph.hxx> + +#include <osl/file.hxx> +#include <osl/process.h> + +extern "C" +{ + SAL_DLLPUBLIC_EXPORT bool SAL_CALL + GraphicImport(SvStream & rStream, Graphic & rGraphic, + FilterConfigItem*); +} + +using namespace ::com::sun::star; + +/* Implementation of Filters test */ + +class EpsFilterTest + : public test::FiltersTest + , public test::BootstrapFixture +{ +public: + EpsFilterTest() : BootstrapFixture(true, false) {} + + virtual bool load(const OUString &, + const OUString &rURL, const OUString &, + unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + + /** + * Ensure CVEs remain unbroken + */ + void testCVEs(); + + CPPUNIT_TEST_SUITE(EpsFilterTest); + CPPUNIT_TEST(testCVEs); + CPPUNIT_TEST_SUITE_END(); +}; + +bool EpsFilterTest::load(const OUString &, + const OUString &rURL, const OUString &, + unsigned int, unsigned int, unsigned int) +{ + SvFileStream aFileStream(rURL, STREAM_READ); + Graphic aGraphic; + return GraphicImport(aFileStream, aGraphic, NULL); +} + +void EpsFilterTest::testCVEs() +{ + testDir(OUString(), + getURLFromSrc("/filter/qa/cppunit/data/eps/"), + OUString()); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(EpsFilterTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 9e8a88b6dace33f6e07ba308f99320124166b971 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 10:28:06 2014 +0100 coverity#706540 Uncaught exception Change-Id: I175050b5ab66f4eeaa658f0aab1739b175d38d51 diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 996e1b6..180a2c0 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/form/XLoadable.hpp> #include <com/sun/star/io/XMarkableStream.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/sdb/XRowSetChangeBroadcaster.hpp> #include <com/sun/star/sdb/XRowSetSupplier.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> @@ -647,7 +648,18 @@ OUString SAL_CALL OControlModel::getName() throw(RuntimeException, std::exceptio void SAL_CALL OControlModel::setName(const OUString& _rName) throw(RuntimeException, std::exception) { + try + { setFastPropertyValue(PROPERTY_ID_NAME, makeAny(_rName)); + } + catch (const css::beans::UnknownPropertyException&) + { + throw WrappedTargetRuntimeException( + "OControlModel::setName", + *const_cast< OControlModel* >( this ), + ::cppu::getCaughtException() + ); + } } // XServiceInfo commit 4fd65ac3292a219162a19d8cf1d06842a4c4d498 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 10:25:12 2014 +0100 coverity#706538 Uncaught exception Change-Id: If23396c545e7add653fa9e5ac6e544aaa794120d diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 55c1822..25debf7 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/io/XObjectInputStream.hpp> #include <com/sun/star/io/XObjectOutputStream.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/RowSetVetoException.hpp> #include <com/sun/star/sdb/SQLContext.hpp> @@ -4077,7 +4078,6 @@ void ODatabaseForm::implRemoved(const InterfaceRef& _rxObject) } } - void SAL_CALL ODatabaseForm::errorOccured(const SQLErrorEvent& _rEvent) throw( RuntimeException, std::exception ) { // give it to my own error listener @@ -4087,21 +4087,29 @@ void SAL_CALL ODatabaseForm::errorOccured(const SQLErrorEvent& _rEvent) throw( R } // com::sun::star::container::XNamed - OUString SAL_CALL ODatabaseForm::getName() throw( RuntimeException, std::exception ) { OUString sReturn; - OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= sReturn; + try + { + OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= sReturn; + } + catch (const css::beans::UnknownPropertyException&) + { + throw WrappedTargetRuntimeException( + "ODatabaseForm::getName", + *const_cast< ODatabaseForm* >( this ), + ::cppu::getCaughtException() + ); + } return sReturn; } - void SAL_CALL ODatabaseForm::setName(const OUString& aName) throw( RuntimeException, std::exception ) { setFastPropertyValue(PROPERTY_ID_NAME, makeAny(aName)); } - } // namespace frm commit 9f65dff35e0928cc705a255a40d41b82b38c4dc3 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 10:10:54 2014 +0100 coverity#704010 Unchecked return value Change-Id: I90750c51ce3b38defdba7ecdb7734172983efa8c diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 1cc5440..eba584d 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -3062,7 +3062,7 @@ void AnimationImporter::importPropertySetContainer( const Atom* pAtom, PropertyS if( pChildAtom->getType() == DFF_msofbtAnimAttributeValue ) { Any aAny; - importAttributeValue( pChildAtom, aAny ); + (void)importAttributeValue( pChildAtom, aAny ); rSet.maProperties[ pChildAtom->getInstance() ] = aAny; } else commit 0048a115219113bd6b5f0278b1b6a6ec7f44ad98 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 10:09:53 2014 +0100 coverity#982248 Unchecked return value Change-Id: Ice8c1b3eab28fc8ef27d802f64b7dd90a0614e42 diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 33adcd1..a73fa73 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -375,7 +375,7 @@ extern "C" void nsscrypto_finalize() SAL_INFO("xmlsecurity.xmlsec", "Unloading module \"" ROOT_CERTS "\" failed because it was not found."); } PK11_LogoutAll(); - NSS_Shutdown(); + (void)NSS_Shutdown(); } ONSSInitializer::ONSSInitializer( commit 3661bcded83eecba762ec7c078c6e23acac85abb Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 10:08:09 2014 +0100 coverity#703957 Unchecked return value Change-Id: If9e3e7297b1539c93902895c50af3fb8f6c83a76 diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 96c114a..afcc626 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1249,13 +1249,13 @@ bool EscherPropertyContainer::CreateShapeProperties( const ::com::sun::star::uno bool bVal = false; ::com::sun::star::uno::Any aAny; sal_uInt32 nShapeAttr = 0; - EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, OUString( "Visible" ), true ); + (void)EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, OUString( "Visible" ), true ); if ( aAny >>= bVal ) { if ( !bVal ) nShapeAttr |= 0x20002; // set fHidden = true } - EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, OUString( "Printable" ), true ); + (void)EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, OUString( "Printable" ), true ); if ( aAny >>= bVal ) { if ( !bVal ) commit d615d83381a0830a815fe2879ce761f1b00b04e9 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 09:59:28 2014 +0100 coverity#1242704 Untrusted loop bound Change-Id: Ib2e00c0cd269dc7ae55b206713fe07e5326072f2 diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index 1b95dd4..4951b65 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -328,12 +328,32 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) case W_META_POLYGON: { - sal_uInt16 nPoints = 0; - pWMF->ReadUInt16( nPoints ); - Polygon aPoly( nPoints ); - for( sal_uInt16 i = 0; i < nPoints; i++ ) - aPoly[ i ] = ReadPoint(); - pOut->DrawPolygon( aPoly ); + bool bRecordOk = true; + + sal_uInt16 nPoints(0); + pWMF->ReadUInt16(nPoints); + + if (nPoints > pWMF->remainingSize() / (2 * sizeof(sal_uInt16))) + { + bRecordOk = false; + } + else + { + Polygon aPoly(nPoints); + for (sal_uInt16 i(0); i < nPoints && pWMF->good(); ++i) + aPoly[ i ] = ReadPoint(); + pOut->DrawPolygon(aPoly); + } + + SAL_WARN_IF(!bRecordOk, "vcl.filter", "polygon record has more points than we can handle"); + + bRecordOk &= pWMF->good(); + + if (!bRecordOk) + { + pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); + break; + } } break; @@ -403,12 +423,32 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) case W_META_POLYLINE: { - sal_uInt16 nPoints = 0; - pWMF->ReadUInt16( nPoints ); - Polygon aPoly( nPoints ); - for(sal_uInt16 i = 0; i < nPoints; i++ ) - aPoly[ i ] = ReadPoint(); - pOut->DrawPolyLine( aPoly ); + bool bRecordOk = true; + + sal_uInt16 nPoints(0); + pWMF->ReadUInt16(nPoints); + + if (nPoints > pWMF->remainingSize() / (2 * sizeof(sal_uInt16))) + { + bRecordOk = false; + } + else + { + Polygon aPoly(nPoints); + for (sal_uInt16 i(0); i < nPoints && pWMF->good(); ++i) + aPoly[ i ] = ReadPoint(); + pOut->DrawPolyLine( aPoly ); + } + + SAL_WARN_IF(!bRecordOk, "vcl.filter", "polyline record has more points than we can handle"); + + bRecordOk &= pWMF->good(); + + if (!bRecordOk) + { + pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); + break; + } } break; commit 1361dfc0aa835dcb134d5de4bac594519aa16efe Author: Caolán McNamara <caol...@redhat.com> Date: Mon Oct 20 09:51:05 2014 +0100 coverity#1242606 Untrusted loop bound Change-Id: Iafa03d4dd65eb343a80996880bc1ed846d1b7491 diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index fba076a..afa3b14 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -3846,7 +3846,7 @@ PPTParaSheet::PPTParaSheet( const PPTParaSheet& rSheet ) *this = rSheet; } -void PPTParaSheet::Read( SdrPowerPointImport& +bool PPTParaSheet::Read( SdrPowerPointImport& #ifdef DBG_UTIL rManager #endif @@ -3903,6 +3903,8 @@ void PPTParaSheet::Read( SdrPowerPointImport& { // number of tabulators rIn.ReadUInt16( nVal16 ); + if (rIn.remainingSize() / sizeof(nVal32) < nVal16) + return false; for ( i = 0; i < nVal16; i++ ) rIn.ReadUInt32( nVal32 ); // reading the tabulators } @@ -3973,6 +3975,7 @@ void PPTParaSheet::Read( SdrPowerPointImport& } nPMask >>= 1; } + return false; } void PPTParaSheet::UpdateBulletRelSize( sal_uInt32 nLevel, sal_uInt16 nFontHeight ) diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index 0626c5d..6bbe818 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -800,7 +800,7 @@ public: explicit PPTParaSheet( sal_uInt32 nInstance ); PPTParaSheet( const PPTParaSheet& rParaSheet ); - void Read( + bool Read( SdrPowerPointImport& rMan, SvStream& rIn, bool bMasterStyle,
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits