diff options
author | Tim Potter <tpot@samba.org> | 2002-07-30 04:32:29 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-07-30 04:32:29 +0000 |
commit | a5a0ff8bd7ee4a3586647d14fd750ec6df73efa8 (patch) | |
tree | dc8d75fb718fe9235fbe35540e9db8a2b3cad2cf | |
parent | 84c1a5b0f046fa0375563120da117a8e76fb5b8c (diff) | |
download | samba-a5a0ff8bd7ee4a3586647d14fd750ec6df73efa8.tar.gz samba-a5a0ff8bd7ee4a3586647d14fd750ec6df73efa8.tar.xz samba-a5a0ff8bd7ee4a3586647d14fd750ec6df73efa8.zip |
Some crash fixes for netshareenum returning zero shares.
-rw-r--r-- | source/libsmb/cli_srvsvc.c | 3 | ||||
-rw-r--r-- | source/rpcclient/cmd_srvsvc.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source/libsmb/cli_srvsvc.c b/source/libsmb/cli_srvsvc.c index b92b356241c..1bdd19620b4 100644 --- a/source/libsmb/cli_srvsvc.c +++ b/source/libsmb/cli_srvsvc.c @@ -116,6 +116,9 @@ WERROR cli_srvsvc_net_share_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, ZERO_STRUCTP(ctr); + if (!r.ctr.num_entries) + goto done; + ctr->info_level = info_level; ctr->num_entries = r.ctr.num_entries; diff --git a/source/rpcclient/cmd_srvsvc.c b/source/rpcclient/cmd_srvsvc.c index 43bfb250489..8d416f8db01 100644 --- a/source/rpcclient/cmd_srvsvc.c +++ b/source/rpcclient/cmd_srvsvc.c @@ -270,7 +270,7 @@ static NTSTATUS cmd_srvsvc_net_share_enum(struct cli_state *cli, result = cli_srvsvc_net_share_enum( cli, mem_ctx, info_level, &ctr, preferred_len, &hnd); - if (!W_ERROR_IS_OK(result)) + if (!W_ERROR_IS_OK(result) || !ctr.num_entries) goto done; /* Display results */ |