[kde-baseapps] dolphin/src/kitemviews: Fix crash when browsing bluetooth device.

Michael Jansen kde at michael-jansen.biz
Thu Jan 3 15:24:21 GMT 2013


Because i searched bko for related crashes and did not find any. So i thought 
it would be a me only problem (nearly everything self-compiled).

Apart from that i never before discussed changes like that. I expect the 
maintainers to read the commit logs. No need to spam you with another message.

Mike

On Thursday, January 03, 2013 09:37:41 AM Frank Reininghaus wrote:
> Hi Michael,
> 
> 2012/12/30 Michael Jansen <kde at michael-jansen.biz>:
> > Git commit f0c90a47de3f59e4a98932ae6f0499921d9aa899 by Michael Jansen.
> > Committed on 30/12/2012 at 20:56.
> > Pushed by mjansen into branch 'master'.
> > 
> > Fix crash when browsing bluetooth device.
> > 
> > When trying to browse a N900 it crashed here because pathA was empty.
> > Which
> > lead to index = maxIndex beeing -1 and pathA.at(index) crashing.
> > 
> > Reorder the while condition to prevent that courtesy of tsdgeos.
> > 
> > M  +1    -1    dolphin/src/kitemviews/kfileitemmodel.cpp
> > 
> > http://commits.kde.org/kde-baseapps/f0c90a47de3f59e4a98932ae6f0499921d9aa8
> > 99
> > 
> > diff --git a/dolphin/src/kitemviews/kfileitemmodel.cpp
> > b/dolphin/src/kitemviews/kfileitemmodel.cpp index 231bfe0..6c015db 100644
> > --- a/dolphin/src/kitemviews/kfileitemmodel.cpp
> > +++ b/dolphin/src/kitemviews/kfileitemmodel.cpp
> > @@ -1499,7 +1499,7 @@ int
> > KFileItemModel::expandedParentsCountCompare(const ItemData* a, const
> > ItemDat> 
> >      if (index > maxIndex) {
> >      
> >          index = maxIndex;
> >      
> >      }
> > 
> > -    while ((pathA.at(index) != QLatin1Char('/') || pathB.at(index) !=
> > QLatin1Char('/')) && index > 0) { +    while (index > 0 &&
> > (pathA.at(index) != QLatin1Char('/') || pathB.at(index) !=
> > QLatin1Char('/'))) {> 
> >          --index;
> >      
> >      }
> 
> first of all, thanks for the fix. Even though the change is obviously
> good, discussing it here before the commit would have enabled me to
> ask the following question before the push, rather than now:
> 
> Why push to master only? Safe crash fixes such as this one should
> definitely be pushed to KDE/4.10 as well.
> 
> Best regards,
> Frank
-- 
Michael Jansen
http://michael-jansen.biz




More information about the kfm-devel mailing list