From a0b2bb97d32c3cabbddd047c91651e734adc7e7e Mon Sep 17 00:00:00 2001 From: KIM JungYong Date: Tue, 27 Sep 2016 22:14:59 +0900 Subject: [PATCH] Fix bug for invaild parse mediaContents. When consumer service receive message and parse mediaContents, sometime app crashed cause by mediaContents consist in the payload but this value is invalid. In this patch, added logic for check to consist and correct mediaContents. Change-Id: Iff2be18efce2697843ea5c73074ada72d2eb751b Signed-off-by: KIM JungYong Reviewed-on: https://gerrit.iotivity.org/gerrit/12339 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi (cherry picked from commit b6001c6ac167769f20c8b1eb4dc84e18c32264b0) Reviewed-on: https://gerrit.iotivity.org/gerrit/12455 --- service/notification/src/consumer/NSConsumerCommunication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/notification/src/consumer/NSConsumerCommunication.c b/service/notification/src/consumer/NSConsumerCommunication.c index afde612..2c0da66 100644 --- a/service/notification/src/consumer/NSConsumerCommunication.c +++ b/service/notification/src/consumer/NSConsumerCommunication.c @@ -253,7 +253,7 @@ NSMessage * NSGetMessage(OCClientResponse * clientResponse) char * icon = NULL; OCRepPayloadGetPropString(payload, NS_ATTRIBUTE_ICON_IMAGE, &icon); - if (icon) + if (icon && strlen(icon)) { NSMediaContents * contents = (NSMediaContents *)OICMalloc(sizeof(NSMediaContents)); if (contents) -- 2.7.4