kdesupport/taglib/taglib/toolkit

Scott Wheeler wheeler at kde.org
Thu Oct 12 23:11:50 CEST 2006


SVN commit 594940 by wheeler:

Don't dereference the iterator before checking its validity.

CCMAIL:taglib-devel at kde.org


 M  +3 -2      tstring.cpp  


--- trunk/kdesupport/taglib/taglib/toolkit/tstring.cpp #594939:594940
@@ -434,8 +434,9 @@
   wstring::const_iterator begin = d->data.begin();
   wstring::const_iterator end = d->data.end();
 
-  while(*begin == '\t' || *begin == '\n' || *begin == '\f' ||
-        *begin == '\r' || *begin == ' ' && begin != end)
+  while(begin != end &&
+        (*begin == '\t' || *begin == '\n' || *begin == '\f' ||
+         *begin == '\r' || *begin == ' '))
   {
     ++begin;
   }


More information about the taglib-devel mailing list