mirror of
https://github.com/KDE/konsole.git
synced 2025-12-23 23:38:08 -05:00
Return early when SSH config file cannot be opened
When attempting to import SSH configurations, the code previously continued
execution even when the config file could not be opened. This could lead
to undefined behavior or crashes when trying to read from an invalid file
handle.
The fix adds an early return statement when file opening fails, ensuring
proper error handling and preventing potential issues downstream.
(cherry picked from commit 70452321ce)
This commit is contained in:
committed by
Kurt Hindenburg
parent
2462393892
commit
978613a529
@@ -332,6 +332,7 @@ void SSHManagerModel::importFromSshConfigFile(const QString &file)
|
||||
QFile sshConfig(file);
|
||||
if (!sshConfig.open(QIODevice::ReadOnly)) {
|
||||
qCDebug(SshManagerPluginDebug) << "Can't open config file";
|
||||
return;
|
||||
}
|
||||
QTextStream stream(&sshConfig);
|
||||
QString line;
|
||||
|
||||
Reference in New Issue
Block a user