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 | 3130577acb03a06fd8de27ee6c2e4f82bd4b2008 (patch) | |
tree | 4cca147ad58c4f6eb1fb820981853f4237587c6b | |
parent | d91cbdac92ca52c96148bc14b109865353728728 (diff) | |
download | samba-3130577acb03a06fd8de27ee6c2e4f82bd4b2008.tar.gz samba-3130577acb03a06fd8de27ee6c2e4f82bd4b2008.tar.bz2 samba-3130577acb03a06fd8de27ee6c2e4f82bd4b2008.zip |
Some crash fixes for netshareenum returning zero shares.
(This used to be commit a5a0ff8bd7ee4a3586647d14fd750ec6df73efa8)
-rw-r--r-- | source3/libsmb/cli_srvsvc.c | 3 | ||||
-rw-r--r-- | source3/rpcclient/cmd_srvsvc.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source3/libsmb/cli_srvsvc.c b/source3/libsmb/cli_srvsvc.c index b92b356241..1bdd19620b 100644 --- a/source3/libsmb/cli_srvsvc.c +++ b/source3/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/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c index 43bfb25048..8d416f8db0 100644 --- a/source3/rpcclient/cmd_srvsvc.c +++ b/source3/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 */ |