]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix Coverity ID 548
authorVolker Lendecke <vl@samba.org>
Fri, 21 Mar 2008 09:28:33 +0000 (10:28 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 21 Mar 2008 09:28:33 +0000 (10:28 +0100)
Günther, please check -- in all infolevels we do a comment=talloc_strdup

Thanks,

Volker

source/rpc_server/srv_srvsvc_nt.c

index a89a99646b6ef174de61eed145b863c5dce008f3..83595119392f1b3efcf45bb95c936f0a502bbdda 100644 (file)
@@ -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" ));