1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

param: pre-emptively correct use of str_list_make_v3 in lib/param

lib/param uses str_list_make, while, s3 uses str_list_make_v3. These
differ slightly and should be made the same.

Notably it returns NULL when given a null or empty string

Also, includes the null check in s3 code to be consistent for merging
this section of code later on.

Change-Id: Ib543a5a5307e06989621ea16bfe87e315d66a7ef
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
This commit is contained in:
Garming Sam 2014-03-13 13:27:24 +13:00 committed by Andrew Bartlett
parent e9a2694e2b
commit 72651f92f0
2 changed files with 8 additions and 0 deletions

View File

@ -1470,6 +1470,10 @@ bool set_variable_helper(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr,
{
char **new_list = str_list_make(mem_ctx,
pszParmValue, NULL);
if (new_list == NULL) {
break;
}
for (i=0; new_list[i]; i++) {
if (*(const char ***)parm_ptr != NULL &&
new_list[i][0] == '+' &&

View File

@ -2688,6 +2688,10 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue
{
char **new_list = str_list_make_v3(mem_ctx,
pszParmValue, NULL);
if (new_list == NULL) {
break;
}
for (i=0; new_list[i]; i++) {
if (*(const char ***)parm_ptr != NULL &&
new_list[i][0] == '+' &&