Subject: ONMainWindow::closeEvent: If statement depends on uninitialised value.
From: Heinrich Schuchardt <[email-masked]>
To: [email-masked]
Date: Fri, 28 Jun 2013 20:53:55 +0200

Package: x2goclient
Version: 4.0.1.0
Severity: normal

Dear maintainer,

if in ONMainWindow::ONMainWindow parseParameter(args[i]) fails, close() 
is called generating a QCLoseEvent.

Up to this point variable trayNoclose has not been initialized. Hence in 
ONMainWindow::closeEvent an unitialised variable trayNoclose is used in 
statement

if (trayNoclose && !brokerMode).

Due to initialization brokerMode=false.

Obviously the behavior of closeEvent() is undefined.

Furthermore in ONMainWindow::closeClient() decisions are based on 
unitialized variables trayIcon, and useLdap.

Please, initialize at least these variables before calling close().

Example:
valgrind x2goclient --leak-check=full
(--leak-check=full is an illegal parameter for x2goclient)

results in:

==7660== Conditional jump or move depends on uninitialised value(s)
==7660==    at 0x468D1C: ONMainWindow::closeEvent(QCloseEvent*) 
(onmainwindow.cpp:1415)

Best regards

Heinrich Schuchardt