Explorar el Código

Check if output arguments are returned at all before accessing the result array proves beneficial if methods do not return arguments (the other choice is a SEGFAULT).

ichrispa hace 9 años
padre
commit
a12c157c89
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/client/ua_client_highlevel.c

+ 1 - 1
src/client/ua_client_highlevel.c

@@ -201,7 +201,7 @@ UA_Client_call(UA_Client *client, const UA_NodeId objectId, const UA_NodeId meth
         return UA_STATUSCODE_BADUNEXPECTEDERROR;
     }
     retval = response.results[0].statusCode;
-    if(retval == UA_STATUSCODE_GOOD) {
+    if(retval == UA_STATUSCODE_GOOD && response.resultsSize > 0) {
         *output = response.results[0].outputArguments;
         *outputSize = response.results[0].outputArgumentsSize;
         response.results[0].outputArguments = NULL;