s3:params:lp_do_section - protect against NULL deref
commit810ae90aa6c34694c692015bb9f47f56ada811d2
authorAndrew Walker <awalker@ixsystems.com>
Mon, 19 Dec 2022 13:17:47 +0000 (19 08:17 -0500)
committerJule Anger <janger@samba.org>
Tue, 3 Jan 2023 18:21:10 +0000 (3 18:21 +0000)
treeaad7bd1b98d0c18cd1e0d6302add6bd4de1b2aea
parentb9d02e857b2cd95a207e06e5c29daa23c45d180d
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