diff options
-rw-r--r-- | source3/locking/locking.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 5090082ba8..1567f8ffcd 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -751,10 +751,13 @@ static struct share_mode_entry *find_share_mode_entry(struct share_mode_data *d, { int i; + if (!is_valid_share_mode_entry(entry)) { + return NULL; + } + for (i=0; i<d->num_share_modes; i++) { struct share_mode_entry *e = &d->share_modes[i]; - if (is_valid_share_mode_entry(entry) && - is_valid_share_mode_entry(e) && + if (is_valid_share_mode_entry(e) && share_modes_identical(e, entry)) { return e; } |