Bug in generated code
Posted: 31 Aug 2017, 12:00
There seems to be a bug in the generated code of UaModeler in file uaprovider_x_call.c.
In function UaProvider_x_CallAsync there is this code:
If UASERVER_SUPPORT_AUTHORIZATION is not defined, I get a compiler warning telling me that pMethodResult is undefined. Replacing it with pResponse->Results fixes the warning and the code compiles fine.
In function UaProvider_x_CallAsync there is this code:
Code: Select all
#if UASERVER_SUPPORT_AUTHORIZATION
/* check if current user is allowed to read */
if (OpcUa_Method_GetExecutable(pMethodNode) == OpcUa_False ||
UaServer_UserMgt_IsExecutable(OpcUa_BaseNode_GetINode(pMethodNode), a_pCallContext->pSession->UserIdentityData) == OpcUa_False ||
UaServer_UserMgt_IsExecutable(OpcUa_BaseNode_GetINode(pObjectNode), a_pCallContext->pSession->UserIdentityData) == OpcUa_False)
{
pResponse->Results[i].StatusCode = OpcUa_BadUserAccessDenied;
continue;
}
#else
if (OpcUa_Method_GetExecutable(pMethodNode) == OpcUa_False ||
OpcUa_Method_GetUserExecutable(pMethodNode) == OpcUa_False)
{
pMethodResult->StatusCode = OpcUa_BadUserAccessDenied;
continue;
}
#endif