arcan1s / netctl-gui

Qt4/Qt5 GUI and Plasmoid which interact with netctl
http://arcanis.name/projects/netctl-gui/
GNU General Public License v3.0
20 stars 2 forks source link

Segfault #5

Closed arcan1s closed 10 years ago

arcan1s commented 10 years ago

in both versions, Qt5 and Qt4 gets segfault with sudo/kdesudo/normal user

gdb Qt5 gdb Qt4 netctl-gui -d

Original message

arcan1s commented 10 years ago

there is an error in this context:

/**
 * @fn getWifiInterface
 */
QString Netctl::getWifiInterface()
{
    if (debug) qDebug() << "[Netctl]" << "[getWifiInterface]";
    if (ifaceDirectory == 0) {
        if (debug) qDebug() << "[Netctl]" << "[getWifiInterface]" << ":" << "Could not find directory";
        return QString();
    }

    QStringList interfaces;
    if (!mainInterface.isEmpty())
        interfaces.append(mainInterface);
    QStringList allInterfaces = ifaceDirectory->entryList(QDir::Dirs | QDir::NoDotAndDotDot);
    for (int i=0; i<allInterfaces.count(); i++) {
        if (debug) qDebug() << "[Netctl]" << "[getWifiInterface]" << ":" << "Check directory"
                 << ifaceDirectory->path() + QDir::separator() + allInterfaces[i] + QDir::separator() + QString("wireless");
        if (QDir(ifaceDirectory->path() + QDir::separator() + allInterfaces[i] +
                 QDir::separator() + Q/String("wireless")).exists())
            interfaces.append(allInterfaces[i]);
    }

    return interfaces[0];
}

If interfaces.count() == 0