[X2Go-Commits] [x2goclient] 02/04: src/httpbrokerclient.cpp: handle missing server name/address gracefully.

git-admin at x2go.org git-admin at x2go.org
Thu Jun 20 21:42:07 CEST 2024


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goclient.

commit e51da1ba3685d8808c97d0ec13f98215e8176520
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Tue Apr 30 21:48:43 2024 +0200

    src/httpbrokerclient.cpp: handle missing server name/address gracefully.
---
 debian/changelog         | 1 +
 src/httpbrokerclient.cpp | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index cf58cc64..36bb3eb7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ x2goclient (4.1.2.4-0x2go1) UNRELEASED; urgency=medium
 
   [ Mihai Moldovan ]
   * New upstream version (4.1.2.4):
+    - src/httpbrokerclient.cpp: handle missing server name/address gracefully.
   * x2goclient.spec:
     + Add Recommends: x2gokdriveclient for FC30+, RH 8+, *SuSE 15.4+.
 
diff --git a/src/httpbrokerclient.cpp b/src/httpbrokerclient.cpp
index fda4cf3e..db05546a 100644
--- a/src/httpbrokerclient.cpp
+++ b/src/httpbrokerclient.cpp
@@ -840,7 +840,14 @@ void HttpBrokerClient::parseSession(QString sinfo)
         config->key=sinfo.mid(keyStartPos, keyEndPos+endStr.length()-keyStartPos);
     }
     QString serverLine=(lst[1].split("\n"))[0];
-    QStringList words=serverLine.split(":",QString::SkipEmptyParts);
+    QStringList words=serverLine.split(":",QString::KeepEmptyParts);
+    if ((words.isEmpty ()) || (words[0].isEmpty ())) {
+        QString msg = tr ("Broker passed no server name or address.");
+        x2goDebug << msg;
+        QMessageBox::critical (0, tr ("Error"), msg);
+        emit (fatalHttpError ());
+        return;
+    }
     config->serverIp=words[0];
     if (words.count()>1)
         config->sshport=words[1];

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list