diff options
-rw-r--r-- | source3/smbd/uid.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 343a0cf490..ffa643a8f5 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -123,9 +123,9 @@ static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum) return False; } - i = conn->vuid_cache.entries; - conn->vuid_cache.entries = - (conn->vuid_cache.entries + 1) % VUID_CACHE_SIZE; + i = conn->vuid_cache.entries % VUID_CACHE_SIZE; + if (conn->vuid_cache.entries < VUID_CACHE_SIZE) + conn->vuid_cache.entries++; ent = &conn->vuid_cache.array[i]; ent->vuid = vuser->vuid; |