]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_host: Fix max_workers calculation
authorVolker Lendecke <vl@samba.org>
Sat, 14 Sep 2024 13:21:49 +0000 (15:21 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 20 Sep 2024 17:13:37 +0000 (17:13 +0000)
To limit max_workers into 16 bits, cap it at UINT16_MAX (65535, not 65536)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
source3/rpc_server/rpc_host.c

index dfc29fad342c1e6b88ab4db8e43653eff3a4fbd2..5232c5f17fae2176dcc7edbc2367a56f68e7a46f 100644 (file)
@@ -611,9 +611,7 @@ static void rpc_server_get_endpoints_done(struct tevent_req *subreq)
         * in order to use a 16-bit association group space
         * per worker.
         */
-       if (state->num_workers > 65536) {
-               state->num_workers = 65536;
-       }
+       state->num_workers = MIN(state->num_workers, UINT16_MAX);
 
        state->idle_seconds = smb_strtoul(
                lines[1], NULL, 10, &ret, SMB_STR_FULL_STR_CONV);