summaryrefslogtreecommitdiffstats
path: root/source3/lib/conn_tdb.c
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2013-07-05 13:19:59 +0200
committerJeremy Allison <jra@samba.org>2013-07-09 14:19:51 -0700
commit53aa069b97070c73b782e2868b9b9686abe353cc (patch)
tree5dd28da8574372009b9191c0d1f1ec2a3646994f /source3/lib/conn_tdb.c
parent191e6b9441d6789ecc16a3a80eb36ec5b410c083 (diff)
downloadsamba-53aa069b97070c73b782e2868b9b9686abe353cc.tar.gz
samba-53aa069b97070c73b782e2868b9b9686abe353cc.tar.xz
samba-53aa069b97070c73b782e2868b9b9686abe353cc.zip
s3-lib: fix segf while reading incomplete session info (bug #10003)
Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/conn_tdb.c')
-rw-r--r--source3/lib/conn_tdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c
index a7e7cf02eb..bb7618f0d4 100644
--- a/source3/lib/conn_tdb.c
+++ b/source3/lib/conn_tdb.c
@@ -53,8 +53,13 @@ static int collect_sessions_fn(struct smbXsrv_session_global0 *global,
uint32_t id = global->session_global_id;
struct connections_forall_session sess;
- sess.uid = global->auth_session_info->unix_token->uid;
- sess.gid = global->auth_session_info->unix_token->gid;
+ if (global->auth_session_info == NULL) {
+ sess.uid = -1;
+ sess.gid = -1;
+ } else {
+ sess.uid = global->auth_session_info->unix_token->uid;
+ sess.gid = global->auth_session_info->unix_token->gid;
+ }
strncpy(sess.machine, global->channels[0].remote_name, sizeof(sess.machine));
strncpy(sess.addr, global->channels[0].remote_address, sizeof(sess.addr));