[Libreoffice-commits] core.git: 2 commits - sd/source unotools/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed May 8 12:03:16 PDT 2013


 sd/source/ui/controller/slidelayoutcontroller.cxx |    2 +-
 unotools/source/i18n/localedatawrapper.cxx        |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit a7adcf0ed0515357d8eaccab4562054b334ca59b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed May 8 20:57:35 2013 +0200

    make clear that this is a false positive report

diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx
index 922b17f..a2e83d3 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.cxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.cxx
@@ -205,7 +205,7 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
     case DrawViewMode_DRAW: pInfo = &standard[0]; break;
     case DrawViewMode_HANDOUT: pInfo = &handout[0]; nColCount = 2; break;
     case DrawViewMode_NOTES: pInfo = &notes[0]; nColCount = 1; break;
-    default: break;
+    default: assert(false); // can't happen, will crash later otherwise
     }
 
     mpLayoutSet1->SetColCount( nColCount );
commit 228659f0a60839e7a9de320509c60fa97d44cab6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed May 8 20:48:14 2013 +0200

    coverity#1019431: use of freed memory

diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 4934854..82b55c1 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -20,6 +20,7 @@
 
 #include <string.h>      // memcpy()
 #include <stdio.h>       // fprintf(), stderr
+#include <string>
 
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/numberformatcodewrapper.hxx>
@@ -1168,7 +1169,7 @@ static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, sal_uInt16 nNumber, bool bL
 
 static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber, bool bLeading )
 {
-    DBG_ASSERT( nNumber < 1000000000, "ImplAdd2UNum() - Number >= 1000000000" );
+    DBG_ASSERT( nNumber < 1000000000, "ImplAdd9UNum() - Number >= 1000000000" );
 
     std::ostringstream ostr;
     if (bLeading)
@@ -1177,7 +1178,8 @@ static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber, bool bL
         ostr.width(9);
     }
     ostr << nNumber;
-    for(const char *pAB=ostr.str().c_str(); *pAB != '\0'; ++pAB, ++pBuf)
+    std::string aStr = ostr.str();
+    for(const char *pAB= aStr.c_str(); *pAB != '\0'; ++pAB, ++pBuf)
     {
         *pBuf = *pAB;
     }


More information about the Libreoffice-commits mailing list