소스 검색

fix(server): fix reference target tree copying in UA_Node_copy

Andranik Simonian 5 년 전
부모
커밋
43c761e460
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      src/server/ua_nodes.c

+ 4 - 3
src/server/ua_nodes.c

@@ -207,15 +207,16 @@ UA_Node_copy(const UA_Node *src, UA_Node *dst) {
                 drefs->refTargets[j].targetHash = srefs->refTargets[j].targetHash;
                 drefs->refTargets[j].zipfields.zip_right = NULL;
                 if(srefs->refTargets[j].zipfields.zip_right)
-                    *(uintptr_t*)&drefs->refTargets[j].zipfields.zip_left =
+                    *(uintptr_t*)&drefs->refTargets[j].zipfields.zip_right =
                         (uintptr_t)srefs->refTargets[j].zipfields.zip_right + arraydiff;
                 drefs->refTargets[j].zipfields.zip_left = NULL;
                 if(srefs->refTargets[j].zipfields.zip_left)
                     *(uintptr_t*)&drefs->refTargets[j].zipfields.zip_left =
                         (uintptr_t)srefs->refTargets[j].zipfields.zip_left + arraydiff;
+                drefs->refTargets[j].zipfields.rank = srefs->refTargets[j].zipfields.rank;
             }
-            srefs->refTargetsTree.zip_root = NULL;
-            if(drefs->refTargetsTree.zip_root)
+            drefs->refTargetsTree.zip_root = NULL;
+            if(srefs->refTargetsTree.zip_root)
                 *(uintptr_t*)&drefs->refTargetsTree.zip_root =
                     (uintptr_t)srefs->refTargetsTree.zip_root + arraydiff;
             drefs->refTargetsSize= srefs->refTargetsSize;