]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2018-1050: s3: RPC: spoolss server. Protect against null pointer derefs.
authorJeremy Allison <jra@samba.org>
Tue, 2 Jan 2018 23:56:03 +0000 (15:56 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 13 Mar 2018 09:28:56 +0000 (10:28 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11343

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/spoolss/srv_spoolss_nt.c

index a9e778ee0231e39aeda1c7936b5ccc06cedbb077..ef147e970e62b547107197b59c7a3d40bc205559 100644 (file)
@@ -182,6 +182,11 @@ static void prune_printername_cache(void);
 static const char *canon_servername(const char *servername)
 {
        const char *pservername = servername;
+
+       if (servername == NULL) {
+               return "";
+       }
+
        while (*pservername == '\\') {
                pservername++;
        }
@@ -2082,6 +2087,10 @@ WERROR _spoolss_DeletePrinterDriver(struct pipes_struct *p,
                return WERR_ACCESS_DENIED;
        }
 
+       if (r->in.architecture == NULL || r->in.driver == NULL) {
+               return WERR_INVALID_ENVIRONMENT;
+       }
+
        /* check that we have a valid driver name first */
 
        if ((version = get_version_id(r->in.architecture)) == -1) {
@@ -2221,6 +2230,10 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p,
                return WERR_ACCESS_DENIED;
        }
 
+       if (r->in.architecture == NULL || r->in.driver == NULL) {
+               return WERR_INVALID_ENVIRONMENT;
+       }
+
        /* check that we have a valid driver name first */
        if (get_version_id(r->in.architecture) == -1) {
                /* this is what NT returns */