Bug 85593

Summary: crash when indirect file points to existing file with zero size
Product: [Applications] kst Reporter: Matthew Truch <matt>
Component: generalAssignee: George Staikos <staikos>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Matthew Truch 2004-07-21 01:19:05 UTC
Version:           0.99-devel (using KDE KDE 3.2.1)
Installed from:    RedHat RPMs
OS:                Linux

kst will crash (sig 11) when you try to select an indirect data file when the indirect data file points to an existing file with zero size.  

how to reproduce:  create an empty file (touch a.txt); create an indirect file pointing to a.txt (echo "a.txt" > a.cur); point kst to this a.cur file.  

expected behavior: kst doesn't crash, and doesn't let you use the file for data (which it does do correctly if you point it directly to the zero length file).
Comment 1 George Staikos 2004-07-24 06:16:57 UTC
#0  QString::deref (this=0x64) at tools/qstring.cpp:1523
#1  0x0ee5f5bc in QString::operator= (this=0x64, s=@0x7fffe428)
    at tools/qstring.cpp:1568
#2  0x0fed1ed4 in findPluginFor (filename=@0x7fffe548, type=@0x0)
    at kstdatasource.cpp:60
#3  0x0fed2178 in KstDataSource::loadSource (filename=@0x7fffe548,
    type=@0x1018e7b4) at kstdatasource.cpp:213
#4  0x100a1488 in KstVectorDialogI::updateCompletion (this=0x103c4b90)
    at kstvectordialog_i.cpp:96
Comment 2 George Staikos 2004-07-24 06:27:52 UTC
CVS commit by staikos: 

indirect plugin requires the ability to return null from the factory, so
it needs to be handled
CCMAIL: 85593-done@bugs.kde.org


  M +3 -1      kstdatasource.cpp   1.24


--- kdeextragear-2/kst/kst/kstdatasource.cpp  #1.23:1.24
@@ -58,5 +58,7 @@ namespace KST {
           //kdDebug() << "Trying to create " << filename << " type=" << type << " with " << service->property("Name").toString() << endl;
           KstDataSource *ds = (sym)(filename, type);
+          if (ds) {
           ds->_source = service->property("Name").toString();
+          }
           //kdDebug() << (ds ? "SUCCESS" : "FAILED") << endl;
           return ds;