Ver código fonte

historydatabackend_memory: Fix lastIndex function.

Peter Rustler 5 anos atrás
pai
commit
7187811ab4
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      plugins/historydata/ua_historydatabackend_memory.c

+ 2 - 0
plugins/historydata/ua_historydatabackend_memory.c

@@ -251,6 +251,8 @@ lastIndex_backend_memory(UA_Server *server,
                          void *sessionContext,
                          const UA_NodeId * nodeId) {
     const UA_NodeIdStoreContextItem_backend_memory* item = getNodeIdStoreContextItem_backend_memory((UA_MemoryStoreContext*)context, server, nodeId);;
+    if (item->storeEnd == 0)
+        return 0;
     return item->storeEnd - 1;
 }