summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1999-01-19 18:01:28 +0000
committerJeremy Allison <jra@samba.org>1999-01-19 18:01:28 +0000
commit3960f719cfe3962c04ae535429216e0666abca9c (patch)
treeadebabbaf74301ebf689852d4b800aa04ba1dc70
parenta9f34936d2cd78ebc661cfc380e13d3b2025f650 (diff)
downloadsamba-3960f719cfe3962c04ae535429216e0666abca9c.tar.gz
samba-3960f719cfe3962c04ae535429216e0666abca9c.tar.xz
samba-3960f719cfe3962c04ae535429216e0666abca9c.zip
Fixed potential core-dump bug where conn pointer was being dereferenced
before check for NULL. Jeremy.
-rw-r--r--source/smbd/uid.c10
1 files 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))