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 <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12339
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
char * icon = NULL;
OCRepPayloadGetPropString(payload, NS_ATTRIBUTE_ICON_IMAGE, &icon);
- if (icon)
+ if (icon && strlen(icon))
{
NSMediaContents * contents = (NSMediaContents *)OICMalloc(sizeof(NSMediaContents));
if (contents)