[Kst] [Bug 120490] Crash when trying to change data sample ranges

George Staikos staikos at kde.org
Fri Jan 20 23:40:10 CET 2006


This is by definition an impossible scenario.  How does it fix anything, and 
how do you know that the vector is null?  A null pointer inside the vector 
list means that Kst is completely screwed up internally, and this will just 
shift the crash elsewhere.

What exactly was the problem here?

On Friday 20 January 2006 16:16, Andrew Walker wrote:
> CCBUG:120490 Prevent crash due to invalid pointers. The numerous 'FIXME:
> broken' comments should be addressed before shipping 1.2 as the associated
> code does appaer to be incorrectly written.
>  @ -174,14 +186,18  @
>    for (uint i = 0; i < cnt; ++i) {
>      if (CurveList->isSelected(i)) {
>        KstRVectorPtr vector = rvl[i]; // FIXME: broken
> -      vector->readLock();
> -      KstDataSourcePtr ds = vector->dataSource();
> -      vector->readUnlock();
> -      ds->readLock();
> -      supportsTime = ds->supportsTimeConversions();
> -      ds->readUnlock();
> -      if (!supportsTime) {
> -        break;
> +      if (vector) {
> +        vector->readLock();
> +        KstDataSourcePtr ds = vector->dataSource();
> +        vector->readUnlock();
> +        if (ds) {
> +          ds->readLock();
> +          supportsTime = ds->supportsTimeConversions();
> +          ds->readUnlock();
> +          if (!supportsTime) {
> +            break;
> +          }

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/


More information about the Kst mailing list