mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
libsmbconf: add handling of NULL strings to smbconf_find_in_array().
Michael
(This used to be commit a5923bafe9
)
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user