From: Amos Jeffries Date: Sun, 17 Feb 2013 02:24:54 +0000 (+1300) Subject: Fix uninitialized member fields in Http* objects X-Git-Tag: SQUID_3_4_0_1~269 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=593d3cdb3e5da90c82a61055dcf519202eb9ae3c;p=thirdparty%2Fsquid.git Fix uninitialized member fields in Http* objects Detected by Coverity Scan. Issues 740516, 740519, 740520, 740620 --- diff --git a/src/HttpHdrRange.cc b/src/HttpHdrRange.cc index 479e4f8e25..a47fdae4a2 100644 --- a/src/HttpHdrRange.cc +++ b/src/HttpHdrRange.cc @@ -224,7 +224,7 @@ HttpHdrRangeSpec::mergeWith(const HttpHdrRangeSpec * donor) * Range */ -HttpHdrRange::HttpHdrRange () : clen (HttpHdrRangeSpec::UnknownPosition) +HttpHdrRange::HttpHdrRange() : clen(HttpHdrRangeSpec::UnknownPosition) {} HttpHdrRange * @@ -285,7 +285,9 @@ HttpHdrRange::~HttpHdrRange() delete specs.pop_back(); } -HttpHdrRange::HttpHdrRange(HttpHdrRange const &old) : specs() +HttpHdrRange::HttpHdrRange(HttpHdrRange const &old) : + specs(), + clen(HttpHdrRangeSpec::UnknownPosition) { specs.reserve(old.specs.size()); diff --git a/src/HttpHeaderTools.h b/src/HttpHeaderTools.h index bdaf6f7da6..d5ba1e888e 100644 --- a/src/HttpHeaderTools.h +++ b/src/HttpHeaderTools.h @@ -77,7 +77,7 @@ private: class HeaderWithAcl { public: - HeaderWithAcl() : aclList(NULL), fieldId (HDR_BAD_HDR), quoted(false) {} + HeaderWithAcl() : valueFormat(NULL), aclList(NULL), fieldId(HDR_BAD_HDR), quoted(false) {} /// HTTP header field name std::string fieldName; diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 7acdca5cd0..308c072ab2 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -116,6 +116,7 @@ HttpRequest::init() errDetail = ERR_DETAIL_NONE; peer_login = NULL; // not allocated/deallocated by this class peer_domain = NULL; // not allocated/deallocated by this class + peer_host = NULL; vary_headers = NULL; myportname = null_string; tag = null_string;