Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Rings:2-TestDVD
tigervnc
U_tigervnc-prevent-leak-of-SecurityServer-and-C...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_tigervnc-prevent-leak-of-SecurityServer-and-ClientServer.patch of Package tigervnc
Git-commit: dccb5f7d776e93863ae10bbff56a45c523c6eeb0 Patch-Mainline: Upstream References: bnc#1031886 From: Michal Srb <michalsrb@gmail.com> Subject: Prevent leak of SecurityServer and ClientServer. They are created in SConnection's and CConnection's constructors but never destroyed. There is no reason for the indirection, so lets make them direct members. Index: tigervnc-1.6.0/common/rfb/CConnection.cxx =================================================================== --- tigervnc-1.6.0.orig/common/rfb/CConnection.cxx +++ tigervnc-1.6.0/common/rfb/CConnection.cxx @@ -37,7 +37,6 @@ CConnection::CConnection() shared(false), state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false) { - security = new SecurityClient(); } CConnection::~CConnection() @@ -123,7 +122,7 @@ void CConnection::processSecurityTypesMs int secType = secTypeInvalid; std::list<rdr::U8> secTypes; - secTypes = security->GetEnabledSecTypes(); + secTypes = security.GetEnabledSecTypes(); if (cp.isVersion(3,3)) { @@ -191,7 +190,7 @@ void CConnection::processSecurityTypesMs } state_ = RFBSTATE_SECURITY; - csecurity = security->GetCSecurity(secType); + csecurity = security.GetCSecurity(secType); processSecurityMsg(); } Index: tigervnc-1.6.0/common/rfb/CConnection.h =================================================================== --- tigervnc-1.6.0.orig/common/rfb/CConnection.h +++ tigervnc-1.6.0/common/rfb/CConnection.h @@ -132,7 +132,7 @@ namespace rfb { stateEnum state() { return state_; } CSecurity *csecurity; - SecurityClient *security; + SecurityClient security; protected: void setState(stateEnum s) { state_ = s; } Index: tigervnc-1.6.0/common/rfb/SConnection.cxx =================================================================== --- tigervnc-1.6.0.orig/common/rfb/SConnection.cxx +++ tigervnc-1.6.0/common/rfb/SConnection.cxx @@ -51,7 +51,7 @@ const SConnection::AccessRights SConnect SConnection::SConnection() : readyForSetColourMapEntries(false), is(0), os(0), reader_(0), writer_(0), - security(0), ssecurity(0), state_(RFBSTATE_UNINITIALISED), + ssecurity(0), state_(RFBSTATE_UNINITIALISED), preferredEncoding(encodingRaw) { defaultMajorVersion = 3; @@ -60,8 +60,6 @@ SConnection::SConnection() defaultMinorVersion = 3; cp.setVersion(defaultMajorVersion, defaultMinorVersion); - - security = new SecurityServer(); } SConnection::~SConnection() @@ -147,7 +145,7 @@ void SConnection::processVersionMsg() std::list<rdr::U8> secTypes; std::list<rdr::U8>::iterator i; - secTypes = security->GetEnabledSecTypes(); + secTypes = security.GetEnabledSecTypes(); if (cp.isVersion(3,3)) { @@ -166,7 +164,7 @@ void SConnection::processVersionMsg() os->writeU32(*i); if (*i == secTypeNone) os->flush(); state_ = RFBSTATE_SECURITY; - ssecurity = security->GetSSecurity(*i); + ssecurity = security.GetSSecurity(*i); processSecurityMsg(); return; } @@ -198,7 +196,7 @@ void SConnection::processSecurityType(in std::list<rdr::U8> secTypes; std::list<rdr::U8>::iterator i; - secTypes = security->GetEnabledSecTypes(); + secTypes = security.GetEnabledSecTypes(); for (i=secTypes.begin(); i!=secTypes.end(); i++) if (*i == secType) break; if (i == secTypes.end()) @@ -209,7 +207,7 @@ void SConnection::processSecurityType(in try { state_ = RFBSTATE_SECURITY; - ssecurity = security->GetSSecurity(secType); + ssecurity = security.GetSSecurity(secType); } catch (rdr::Exception& e) { throwConnFailedException(e.str()); } Index: tigervnc-1.6.0/common/rfb/SConnection.h =================================================================== --- tigervnc-1.6.0.orig/common/rfb/SConnection.h +++ tigervnc-1.6.0/common/rfb/SConnection.h @@ -203,7 +203,7 @@ namespace rfb { rdr::OutStream* os; SMsgReader* reader_; SMsgWriter* writer_; - SecurityServer *security; + SecurityServer security; SSecurity* ssecurity; stateEnum state_; rdr::S32 preferredEncoding;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor