Return an error instantly if the subject string is empty 71/89971/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 28 Sep 2016 02:21:40 +0000 (11:21 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 28 Sep 2016 02:21:40 +0000 (11:21 +0900)
Change-Id: I425062f22b8d91a9a51cd5b68d29fdffe1a8bfe9
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/ContextManager.cpp

index c3c548c..7d07966 100644 (file)
@@ -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;