Bug in generated code

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
fgbw
Jr. Member
Jr. Member
Posts: 1
Joined: 31 Aug 2017, 11:53

Bug in generated code

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

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Bug in generated code

Post by Support Team »

Hello,

We releast a new version of UaModeler. The templates for codegeneration are updated. The issue you described is fixed.
Best regards
Unified Automation Support Team

Post Reply