// Restore the null terminator with an escaped '%' character, per RFC 6874
OICStrcpy(outputAddress, scopeIdPart - addressPart, addressPart);
- strcat(outputAddress, "%25");
- strcat(outputAddress, scopeIdPart);
+ OICStrcat(outputAddress, outputSize, "%25");
+ OICStrcat(outputAddress, outputSize, scopeIdPart);
return OC_STACK_OK;
}
result = OC_STACK_NO_MEMORY;
goto error;
}
- strcpy(*resourceUri, slash);
+ OICStrcpy(*resourceUri, (ulen + 1), slash);
}
// resource type
if (type && resourceType)
goto error;
}
- OICStrcpy(*resourceType, (tlen+1), type);
+ OICStrcpy(*resourceType, (tlen + 1), type);
}
}
{
size_t rtDim[MAX_REP_ARRAY_DEPTH] = {numElement, 0, 0};
char **rt = (char **)OICMalloc(sizeof(char *) * numElement);
+ if (!rt)
+ {
+ OIC_LOG(ERROR, TAG, "Could not allocate memory for rf");
+ return OC_STACK_NO_MEMORY;
+ }
for (uint8_t i = 0; i < numElement; ++i)
{
const char *value = OCGetResourceTypeName(g_keepAliveHandle, i);