From 8dd3c8372e291717b3d02c411fe63f2b365cdb9f Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 2 Mar 2015 09:12:45 +0100 Subject: Check for a nil pointer passed to string_to_ObjectId, resolves several Coverity reported errrors --- TAO/tao/PortableServer/PortableServer_Functions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TAO/tao/PortableServer/PortableServer_Functions.cpp b/TAO/tao/PortableServer/PortableServer_Functions.cpp index 853bd2b7ea2..fe9c1f5f45a 100644 --- a/TAO/tao/PortableServer/PortableServer_Functions.cpp +++ b/TAO/tao/PortableServer/PortableServer_Functions.cpp @@ -9,6 +9,13 @@ namespace PortableServer PortableServer::ObjectId * string_to_ObjectId (const char *string) { + // Passing in a nil pointer is illegal so throw an exception to + // indicate that + if (string == 0) + { + throw ::CORBA::BAD_PARAM (); + } + // Size of string // // We DO NOT include the zero terminator, as this is simply an -- cgit v1.2.1