s3-spoolss: Fixed a possible segfault in winreg_get_printer.
authorSimo Sorce <idra@samba.org>
Mon, 26 Jul 2010 17:14:03 +0000 (19:14 +0200)
committerSimo Sorce <idra@samba.org>
Tue, 27 Jul 2010 14:27:16 +0000 (10:27 -0400)
source3/rpc_server/srv_spoolss_util.c

index 603a0b270239379452d84719135b9628c17e9942..768171a2772ab62c4e35c8a681deeeaeb85f303e 100644 (file)
@@ -2140,7 +2140,7 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
        }
 
        /* Create the printername */
-       if (info2->servername[0] != '\0') {
+       if (info2->servername != NULL && info2->servername[0] != '\0') {
                if (lp_force_printername(snum)) {
                        const char *p = talloc_asprintf(info2, "%s\\%s",
                                                        info2->servername,