From ede337b7d4f89a8eec5bf49ff1626d231f3b74e1 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 23 Feb 2010 21:55:44 +0000 Subject: [PATCH] suppressed unninitialisez memory reads git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2407 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/rsiface/rsforums.h | 55 +++++++++++++++++---------- libretroshare/src/rsiface/rstypes.h | 57 ++++++++++++++++------------ 2 files changed, 68 insertions(+), 44 deletions(-) diff --git a/libretroshare/src/rsiface/rsforums.h b/libretroshare/src/rsiface/rsforums.h index 4e83ccd1e..9c20ba8ab 100644 --- a/libretroshare/src/rsiface/rsforums.h +++ b/libretroshare/src/rsiface/rsforums.h @@ -40,43 +40,58 @@ class ForumInfo { public: - ForumInfo() {} - std::string forumId; - std::wstring forumName; - std::wstring forumDesc; + ForumInfo() + { + forumFlags = 0 ; + subscribeFlags = 0 ; + pop = 0 ; + lastPost = 0 ; + } + std::string forumId; + std::wstring forumName; + std::wstring forumDesc; - uint32_t forumFlags; - uint32_t subscribeFlags; + uint32_t forumFlags; + uint32_t subscribeFlags; - uint32_t pop; + uint32_t pop; - time_t lastPost; + time_t lastPost; }; class ForumMsgInfo { public: - ForumMsgInfo() {} - std::string forumId; - std::string threadId; - std::string parentId; - std::string msgId; + ForumMsgInfo() + { + msgflags = 0 ; + ts = childTS = 0 ; + } + std::string forumId; + std::string threadId; + std::string parentId; + std::string msgId; - std::string srcId; /* if Authenticated -> signed here */ + std::string srcId; /* if Authenticated -> signed here */ - unsigned int msgflags; + unsigned int msgflags; - std::wstring title; - std::wstring msg; - time_t ts; - time_t childTS; + std::wstring title; + std::wstring msg; + time_t ts; + time_t childTS; }; class ThreadInfoSummary { public: - ThreadInfoSummary() {} + ThreadInfoSummary() + { + msgflags = 0 ; + count = 0 ; + ts = childTS = 0 ; + } std::string forumId; std::string threadId; std::string parentId; diff --git a/libretroshare/src/rsiface/rstypes.h b/libretroshare/src/rsiface/rstypes.h index cb68af237..4b75c87cc 100644 --- a/libretroshare/src/rsiface/rstypes.h +++ b/libretroshare/src/rsiface/rstypes.h @@ -131,37 +131,46 @@ std::ostream &operator<<(std::ostream &out, const FileInfo &info); class RsConfig { public: - std::string ownId; - std::string ownName; + RsConfig() + { + localPort = extPort = 0 ; + firewalled = forwardPort = false ; + maxDownloadDataRate = maxUploadDataRate = maxIndivDataRate = 0 ; + promptAtBoot = 0 ; + DHTActive = uPnPActive = netLocalOk = netDhtOk = netStunOk = netExtraAddressOk = false ; + uPnPState = DHTPeers = 0 ; + } + std::string ownId; + std::string ownName; - std::string localAddr; - int localPort; - std::string extAddr; - int extPort; - std::string extName; + std::string localAddr; + int localPort; + std::string extAddr; + int extPort; + std::string extName; - bool firewalled; - bool forwardPort; + bool firewalled; + bool forwardPort; - int maxDownloadDataRate; /* kb */ - int maxUploadDataRate; /* kb */ - int maxIndivDataRate; /* kb */ + int maxDownloadDataRate; /* kb */ + int maxUploadDataRate; /* kb */ + int maxIndivDataRate; /* kb */ - int promptAtBoot; /* popup the password prompt */ + int promptAtBoot; /* popup the password prompt */ - /* older data types */ - bool DHTActive; - bool uPnPActive; + /* older data types */ + bool DHTActive; + bool uPnPActive; - int uPnPState; - int DHTPeers; + int uPnPState; + int DHTPeers; - /* Flags for Network Status */ - bool netLocalOk; /* That we've talked to someone! */ - bool netUpnpOk; /* upnp is enabled and active */ - bool netDhtOk; /* response from dht */ - bool netStunOk; /* recvd stun / udp packets */ - bool netExtraAddressOk; /* recvd ip address with external finder*/ + /* Flags for Network Status */ + bool netLocalOk; /* That we've talked to someone! */ + bool netUpnpOk; /* upnp is enabled and active */ + bool netDhtOk; /* response from dht */ + bool netStunOk; /* recvd stun / udp packets */ + bool netExtraAddressOk; /* recvd ip address with external finder*/ }; /********************** For Search Interface *****************/