Browse Source

Imply arraydims of one only for arrays with no arraydims defined

Julius Pfrommer 6 years ago
parent
commit
3b47ab444f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/server/ua_services_attribute.c

+ 1 - 1
src/server/ua_services_attribute.c

@@ -651,7 +651,7 @@ compatibleValueRankValue(UA_Int32 valueRank, const UA_Variant *value) {
         return true;
         return true;
 
 
     size_t arrayDims = value->arrayDimensionsSize;
     size_t arrayDims = value->arrayDimensionsSize;
-    if(!UA_Variant_isScalar(value))
+    if(arrayDims == 0 && !UA_Variant_isScalar(value))
         arrayDims = 1; /* array but no arraydimensions -> implicit array dimension 1 */
         arrayDims = 1; /* array but no arraydimensions -> implicit array dimension 1 */
     return compatibleValueRankArrayDimensions(valueRank, arrayDims);
     return compatibleValueRankArrayDimensions(valueRank, arrayDims);
 }
 }