Przeglądaj źródła

fix oss-fuzz issue in session cleanup

Julius Pfrommer 6 lat temu
rodzic
commit
a6d732b405
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      src/server/ua_session_manager.c

+ 5 - 1
src/server/ua_session_manager.c

@@ -32,6 +32,9 @@ removeSessionCallback(UA_Server *server, void *entry) {
 
 static UA_StatusCode
 removeSession(UA_SessionManager *sm, session_list_entry *sentry) {
+    /* Detach the Session from the SecureChannel */
+    UA_Session_detachFromSecureChannel(&sentry->session);
+
     /* Deactivate the session */
     sentry->session.activated = false;
 
@@ -45,7 +48,8 @@ removeSession(UA_SessionManager *sm, session_list_entry *sentry) {
         return retval; /* Try again next time */
     }
 
-    /* Detach the session and make the capacity available */
+    /* Detach the session from the session manager and make the capacity
+     * available */
     LIST_REMOVE(sentry, pointers);
     UA_atomic_add(&sm->currentSessionCount, (UA_UInt32)-1);
     return UA_STATUSCODE_GOOD;