Pārlūkot izejas kodu

Bad max check when creating a new subscription

During the creation of a new subscription the number of active
subscriptions are compared to the maximum number of subscriptions
allowed to be created. However, this check validated against
number of received publish requests instead of number of
active subscriptions.
Jonas Green 6 gadi atpakaļ
vecāks
revīzija
966d1805fa
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/server/ua_services_subscription.c

+ 1 - 1
src/server/ua_services_subscription.c

@@ -71,7 +71,7 @@ Service_CreateSubscription(UA_Server *server, UA_Session *session,
                            UA_CreateSubscriptionResponse *response) {
                            UA_CreateSubscriptionResponse *response) {
     /* Check limits for the number of subscriptions */
     /* Check limits for the number of subscriptions */
     if((server->config.maxSubscriptionsPerSession != 0) &&
     if((server->config.maxSubscriptionsPerSession != 0) &&
-       (session->numPublishReq >= server->config.maxSubscriptionsPerSession)) {
+       (session->numSubscriptions >= server->config.maxSubscriptionsPerSession)) {
         response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS;
         response->responseHeader.serviceResult = UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS;
         return;
         return;
     }
     }