summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-28 10:14:26 +0100
committerGünther Deschner <gd@samba.org>2008-02-28 10:15:31 +0100
commitb2ed9341ee309acf2cb6f81bff4bc9243bf21d55 (patch)
treee7135a919d0ea1564e0dacf20072005fab2f6e25
parent732f69eb6b9c8e1ce962dd556dd090343bccdc27 (diff)
downloadsamba-b2ed9341ee309acf2cb6f81bff4bc9243bf21d55.tar.gz
samba-b2ed9341ee309acf2cb6f81bff4bc9243bf21d55.tar.bz2
samba-b2ed9341ee309acf2cb6f81bff4bc9243bf21d55.zip
Fix segfault in _srv_net_file_enum.
Guenther (This used to be commit 6523a051ded9f7b433fcce2d4c4a5f186b5a28f6)
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index f0680a89e5..37bd204f75 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1216,17 +1216,20 @@ done:
WERROR _srv_net_file_enum(pipes_struct *p, SRV_Q_NET_FILE_ENUM *q_u, SRV_R_NET_FILE_ENUM *r_u)
{
+ const char *username = NULL;
+
switch ( q_u->level ) {
- case 3: {
- char *username;
- if (!(username = rpcstr_pull_unistr2_talloc(
- p->mem_ctx, q_u->username))) {
- return WERR_NOMEM;
+ case 3:
+ if (q_u->username) {
+ username = rpcstr_pull_unistr2_talloc(
+ p->mem_ctx, q_u->username);
+ if (!username) {
+ return WERR_NOMEM;
+ }
}
return net_file_enum_3(username, r_u,
get_enum_hnd(&q_u->enum_hnd));
- }
default:
return WERR_UNKNOWN_LEVEL;
}