From: Mu-Woong Lee Date: Wed, 28 Sep 2016 02:21:40 +0000 (+0900) Subject: Return an error instantly if the subject string is empty X-Git-Tag: submit/tizen/20160928.054547^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fbabf9ead5da25825e9b73bdef339c34a4b00ff;p=platform%2Fcore%2Fcontext%2Fcontext-service.git Return an error instantly if the subject string is empty Change-Id: I425062f22b8d91a9a51cd5b68d29fdffe1a8bfe9 Signed-off-by: Mu-Woong Lee --- diff --git a/src/ContextManager.cpp b/src/ContextManager.cpp index c3c548c..7d07966 100644 --- a/src/ContextManager.cpp +++ b/src/ContextManager.cpp @@ -58,7 +58,15 @@ void ContextManager::release() void ContextManager::assignRequest(RequestInfo* request) { - ProviderHandler *handle = ProviderHandler::getInstance(request->getSubject(), true); + std::string subject = request->getSubject(); + if (subject.empty()) { + _W("Empty subject name"); + request->reply(ERR_NOT_SUPPORTED); + delete request; + return; + } + + ProviderHandler *handle = ProviderHandler::getInstance(subject, true); if (!handle || !handle->isSupported()) { request->reply(ERR_NOT_SUPPORTED); delete request;