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

List:       kde-bugs-dist
Subject:    [Bug 92028] crashes when reading tags from a mpc file
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2004-10-28 22:11:52
Message-ID: 20041028221152.9702.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
        
http://bugs.kde.org/show_bug.cgi?id=92028        
wheeler kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From wheeler kde org  2004-10-29 00:11 -------
CVS commit by wheeler: 

Make sure that there's (a) data in a bytevector that we're trying to convert
to an integer before trying to convert it and (b) make sure that there's data
in an APE::Item before trying to parse it.

BUG:92028


  M +6 -1      ape/apeitem.cpp   1.5
  M +6 -0      toolkit/tbytevector.cpp   1.46


--- kdesupport/taglib/ape/apeitem.cpp  #1.4:1.5
 @ -124,6 +124,11  @ bool APE::Item::isEmpty() const
 }
 
-void APE::Item::parse(const ByteVector& data)
+void APE::Item::parse(const ByteVector &data)
 {
+  if(data.size() < 10) {
+    debug("APE::Item::parse() -- no data in item");
+    return;
+  }
+
   uint valueLength  = data.mid(0, 4).toUInt(false);
   uint flags        = data.mid(4, 4).toUInt(false);

--- kdesupport/taglib/toolkit/tbytevector.cpp  #1.45:1.46
 @ -190,4 +190,10  @ namespace TagLib {
   {
     T sum = 0;
+
+    if(data.size() <= 0) {
+      debug("ByteVectorMirror::toNumber<T>() -- data is empty, returning 0");
+      return sum;
+    }
+
     uint size = sizeof(T);
     uint last = data.size() > size ? size - 1 : data.size() - 1;
[prev in list] [next in list] [prev in thread] [next in thread] 

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