[X2Go-Dev] Bug#253: ONMainWindow::closeEvent: If statement depends on uninitialised value.

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Jun 28 20:53:55 CEST 2013


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



More information about the x2go-dev mailing list