Browse Source

uninitialized variables-core

AzaezelX 5 years ago
parent
commit
1cea8ffacb
2 changed files with 16 additions and 5 deletions
  1. 15 5
      Engine/source/app/net/httpObject.cpp
  2. 1 0
      Engine/source/app/net/serverQuery.h

+ 15 - 5
Engine/source/app/net/httpObject.cpp

@@ -114,12 +114,22 @@ ConsoleDocClass( HTTPObject,
 //--------------------------------------
 
 HTTPObject::HTTPObject()
+   : mParseState(ParsingStatusLine),
+   mTotalBytes(0),
+   mBytesRemaining(0),
+   mStatus(0),
+   mVersion(0.0f),
+   mContentLength(0),
+   mChunkedEncoding(false),
+   mChunkSize(0),
+   mContentType(""),
+   mHostName(NULL),
+   mPath(NULL),
+   mQuery(NULL),
+   mPost(NULL),
+   mBufferSave(NULL),
+   mBufferSaveSize(0)
 {
-   mHostName = 0;
-   mPath = 0;
-   mQuery = 0;
-   mPost = 0;
-   mBufferSave = 0;
 }
 
 HTTPObject::~HTTPObject()

+ 1 - 0
Engine/source/app/net/serverQuery.h

@@ -80,6 +80,7 @@ struct ServerInfo
       statusString = NULL;
       infoString = NULL;
       version = 0;
+      dMemset(&address, '\0', sizeof(NetAddress));
       ping = 0;
       cpuSpeed = 0;
       isFavorite = false;