diff options
author | Volker Lendecke <vl@samba.org> | 2008-03-21 10:28:33 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-03-21 10:28:33 +0100 |
commit | 35cab4a8c27b3471557bbbd04d8bcf49dfec51c0 (patch) | |
tree | c5432a341f69db3853b0ac7fdc010099c203609a /source3/rpc_server | |
parent | 296bbc3c9f5b13bc1d3639e104b7fab307b8f184 (diff) | |
download | samba-35cab4a8c27b3471557bbbd04d8bcf49dfec51c0.tar.gz samba-35cab4a8c27b3471557bbbd04d8bcf49dfec51c0.tar.bz2 samba-35cab4a8c27b3471557bbbd04d8bcf49dfec51c0.zip |
Fix Coverity ID 548
Günther, please check -- in all infolevels we do a comment=talloc_strdup
Thanks,
Volker
(This used to be commit e2021c5b5710768968ae724220eb1e3f47c9e639)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index a89a99646b..8359511939 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -1580,6 +1580,10 @@ WERROR _srvsvc_NetShareSetInfo(pipes_struct *p, if (type != STYPE_DISKTREE) return WERR_ACCESS_DENIED; + if (comment == NULL) { + return WERR_NOMEM; + } + /* Check if the pathname is valid. */ if (!(path = valid_share_pathname(p->mem_ctx, pathname ))) return WERR_OBJECT_PATH_INVALID; @@ -1587,9 +1591,7 @@ WERROR _srvsvc_NetShareSetInfo(pipes_struct *p, /* Ensure share name, pathname and comment don't contain '"' characters. */ string_replace(share_name, '"', ' '); string_replace(path, '"', ' '); - if (comment) { - string_replace(comment, '"', ' '); - } + string_replace(comment, '"', ' '); DEBUG(10,("_srvsvc_NetShareSetInfo: change share command = %s\n", lp_change_share_cmd() ? lp_change_share_cmd() : "NULL" )); |