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>
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(