[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    KShortURIFilter::configure(): variable accessed before initialised
From:       "Andreas Leuner" <al14 () inf ! tu-dresden ! de>
Date:       2005-10-30 16:58:57
Message-ID: 42751.212.144.2.5.1130691537.squirrel () mail ! inf ! tu-dresden ! de
[Download RAW message or body]

Hi,

When using valgrind on konqueror it complains like this:
"Conditional jump or move depends on uninitialised value(s)"

about KShortURIFilter::configure().

Indeed the variable m_bVerbose is accessed before it is ever written to.
The following patch remedies this:

Index: kshorturifilter.cpp
===================================================================
--- kshorturifilter.cpp (Revision 474751)
+++ kshorturifilter.cpp (Arbeitskopie)
@@ -513,12 +513,12 @@

 void KShortURIFilter::configure()
 {
+  KConfig config( name() + QFL1("rc"), false, false );
+  m_bVerbose = config.readBoolEntry( "Verbose", false );
   if ( m_bVerbose )
     kdDebug() << "KShortURIFilter::configure: Config reload request..."
<< endl;

-  KConfig config( name() + QFL1("rc"), false, false );
   m_strDefaultProtocol = config.readEntry( "DefaultProtocol",
QFL1("http://") );
-  m_bVerbose = config.readBoolEntry( "Verbose", false );
   EntryMap patterns = config.entryMap( QFL1("Pattern") );
   const EntryMap protocols = config.entryMap( QFL1("Protocol") );
   config.setGroup("Type");
_____________________________________________________________________

This was not much more work than generating a suppression for valgrind :-)

Andreas Leuner

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic