From 0e7497936ce71a65af00ac08fa372082310c2fba Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Apr 2008 13:50:27 +0200 Subject: libsmbconf: add handling of NULL strings to smbconf_find_in_array(). Michael (This used to be commit a5923bafe9b543d50dca06d251186948baeac8cc) --- source3/lib/smbconf/smbconf_util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/lib/smbconf/smbconf_util.c b/source3/lib/smbconf/smbconf_util.c index 20bd51a62b..b2e253dd26 100644 --- a/source3/lib/smbconf/smbconf_util.c +++ b/source3/lib/smbconf/smbconf_util.c @@ -111,12 +111,14 @@ bool smbconf_find_in_array(const char *string, char **list, { uint32_t i; - if ((string == NULL) || (list == NULL)) { + if (list == NULL) { return false; } for (i = 0; i < num_entries; i++) { - if (strequal(string, list[i])) { + if (((string == NULL) && (list[i] == NULL)) || + strequal(string, list[i])) + { if (entry != NULL) { *entry = i; } -- cgit