1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

srvsvcd: Fix shareinfo2 max_connections calculation

lp_max_connections() being an int could be >UINT32_MAX

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-05-15 13:17:06 +02:00 committed by Jeremy Allison
parent 8ea8526d13
commit c90aff07ab

View File

@ -282,9 +282,13 @@ static void init_srv_share_info_2(struct pipes_struct *p,
char *remark = NULL;
char *path = NULL;
int max_connections = lp_max_connections(snum);
uint32_t max_uses = max_connections!=0 ? max_connections : UINT32_MAX;
uint32_t max_uses = UINT32_MAX;
char *net_name = lp_servicename(talloc_tos(), lp_sub, snum);
if (max_connections > 0) {
max_uses = MIN(max_connections, UINT32_MAX);
}
remark = lp_comment(p->mem_ctx, lp_sub, snum);
if (remark) {
remark = talloc_sub_full(