Kaynağa Gözat

fix oss-fuzz issue in session cleanup

Julius Pfrommer 6 yıl önce
ebeveyn
işleme
a6d732b405
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  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;