libkcddb and missing error string

Alexander Neundorf neundorf at kde.org
Tue Jul 20 20:09:04 BST 2004


On Tuesday 20 July 2004 17:05, Benjamin Meyer wrote:
> in cddb's resultToString() function one of the error enums is
> missing.  This is a pretty anoying/big bug?  Is it ok to add
> that string "Server error" for that enum?
>
> -Benjamin Meyer

libkccdb also features a misuse of KConfigSkeleton in 

Client::Client(const Config & config) : QObject(),
    cdInfoLookup(0),
    cdInfoSubmit(0)
{
    d = new Private;  
    d->config = config;   //// <- this line
}

I didn't find an operator= for the KConfigSkeleton class, so it is simply 
memcpy'ied, and crashes in the dtor when both copies try to delete their 
members.

The following patch would at least make sure that this bug is already found at 
compile time:

Index: kconfigskeleton.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kconfigskeleton.h,v
retrieving revision 1.24
diff -b -u -p -r1.24 kconfigskeleton.h
--- kconfigskeleton.h	18 Mar 2004 13:23:12 -0000	1.24
+++ kconfigskeleton.h	19 Jun 2004 21:22:33 -0000
@@ -1198,6 +1198,8 @@ protected:
   }
 
 private:
+  KConfigSkeleton(const KConfigSkeleton&);
+
   QString mCurrentGroup;
 
   KSharedConfig::Ptr mConfig; // pointer to KConfig object

Bye
Alex
-- 
Work: alexander.neundorf at jenoptik.com - http://www.jenoptik-los.de
Home: neundorf at kde.org                - http://www.kde.org
      alex at neundorf.net               - http://www.neundorf.net




More information about the kde-core-devel mailing list