From 3960f719cfe3962c04ae535429216e0666abca9c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 19 Jan 1999 18:01:28 +0000 Subject: Fixed potential core-dump bug where conn pointer was being dereferenced before check for NULL. Jeremy. --- source/smbd/uid.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/smbd/uid.c b/source/smbd/uid.c index bf9e294808e..8eb34e24063 100644 --- a/source/smbd/uid.c +++ b/source/smbd/uid.c @@ -187,6 +187,11 @@ BOOL become_user(connection_struct *conn, uint16 vuid) gid_t gid; uid_t uid; + if (!conn) { + DEBUG(2,("Connection not open\n")); + return(False); + } + /* * We need a separate check in security=share mode due to vuid * always being UID_FIELD_INVALID. If we don't do this then @@ -207,11 +212,6 @@ BOOL become_user(connection_struct *conn, uint16 vuid) unbecome_user(); - if (!conn) { - DEBUG(2,("Connection not open\n")); - return(False); - } - snum = SNUM(conn); if((vuser != NULL) && !check_user_ok(conn, vuser, snum)) -- cgit