Page 1 of 1

Bug in generated code

Posted: 31 Aug 2017, 12:00
by fgbw
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:

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
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.

Re: Bug in generated code

Posted: 07 Sep 2017, 16:06
by Support Team
Hello,

We releast a new version of UaModeler. The templates for codegeneration are updated. The issue you described is fixed.