From b5d9f373360cc6b7d57e3a415f1b157c9b5a24a3 Mon Sep 17 00:00:00 2001 From: Phil Mesnier Date: Fri, 8 Feb 2013 22:36:59 +0000 Subject: Fri Feb 8 22:28:42 UTC 2013 Phil Mesnier * tao/Dynamic_TP/DTP_ORBInitializer.cpp: Fix Coverity 972925. Unchecked dynamic cast. * tao/Dynamic_TP/DTP_Task.cpp: Fix Coverity 972742. Unintialized members. * tao/PortableServer/ServantRetentionStrategyNonRetain.h: * tao/PortableServer/ServantRetentionStrategyNonRetain.cpp: Fix Coverity 972992. Stray pointer arethmetic. * utils/logWalker/GIOP_Buffer.cpp: Fix Coverity 972917. Logically dead code. * utils/logWalker/Log.cpp: Fix Coverity 972930. Potential null dereference. --- TAO/utils/logWalker/GIOP_Buffer.cpp | 12 ++++++++---- TAO/utils/logWalker/Log.cpp | 8 ++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'TAO/utils') diff --git a/TAO/utils/logWalker/GIOP_Buffer.cpp b/TAO/utils/logWalker/GIOP_Buffer.cpp index f58c36cdb32..b89baedadae 100644 --- a/TAO/utils/logWalker/GIOP_Buffer.cpp +++ b/TAO/utils/logWalker/GIOP_Buffer.cpp @@ -166,12 +166,16 @@ GIOP_Buffer::GIOP_Buffer(const char *text, header_parsed_ (false), payload_start_ (0) { - const char *size_str = ACE_OS::strstr(text, size_leadin) + leadin_len; - const char *id = size_str == 0 ? 0 : ACE_OS::strchr(size_str, '[') + 1; + const char *size_str = ACE_OS::strstr(text, size_leadin); + if (size_str != 0) + { + size_str += 4; + this->expected_size_ = ACE_OS::strtol(size_str, 0, 10); + const char *id = ACE_OS::strchr(size_str, '[') + 1; + this->expected_req_id_ = ACE_OS::strtol(id, 0, 10); + } this->sending_ = ACE_OS::strstr(text,"send") ? 0 : 1; this->expected_type_ = ACE_OS::strstr(text,"Request") ? 0 : 1; - this->expected_size_ = ACE_OS::strtol(size_str, 0,10); - this->expected_req_id_ = ACE_OS::strtol(id, 0, 10); const char *time_tok = ACE_OS::strchr (text,'@'); if (time_tok != 0) { diff --git a/TAO/utils/logWalker/Log.cpp b/TAO/utils/logWalker/Log.cpp index b54e4e22301..783b5ac63e3 100644 --- a/TAO/utils/logWalker/Log.cpp +++ b/TAO/utils/logWalker/Log.cpp @@ -463,6 +463,14 @@ Log::parse_cleanup_queue_i (void) char *hpos = ACE_OS::strchr(this->info_,'['); long handle = ACE_OS::strtol(hpos+1,0,10); PeerProcess *pp = this->hostproc_->find_peer(handle); + if (pp == 0) + { + ACE_ERROR ((LM_ERROR, + "%d: cleanup queue, error parsing %C, can't find peer " + "for handle %d, text = %s\n", + this->offset_, this->origin_.c_str(), handle, this->info_)); + return; + } Thread *original_thr = this->thr_; GIOP_Buffer *target = original_thr->giop_target(); -- cgit v1.2.1