s3:params:lp_do_section - protect against NULL deref
commit72e6fff0e5f61ad4f0d636bcd212120805577032
authorAndrew Walker <awalker@ixsystems.com>
Mon, 19 Dec 2022 13:17:47 +0000 (19 08:17 -0500)
committerJule Anger <janger@samba.org>
Wed, 4 Jan 2023 20:20:16 +0000 (4 20:20 +0000)
treefab5a4cf8ccac34d2ea2182a8e2197c3eafce2a8
parent4f47415e248452dc34b10008474853bbc81a2165
s3:params:lp_do_section - protect against NULL deref

iServiceIndex may indicate an empty slot in the ServicePtrs
array. In this case, lpcfg_serivce_ok(ServicePtrs[iServiceIndex])
may trigger a NULL deref and crash. Skipping the check
here will cause a scan of the array in add_a_service() and the
NULL slot will be used safely.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15267

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec 20 18:49:54 UTC 2022 on sn-devel-184

(cherry picked from commit 5b19288949e97a5af742ff2719992d56f21e364a)
source3/param/loadparm.c