summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-31 00:47:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:49 -0500
commit576e17cbf3fe10cb8338ab00eeea6211266af390 (patch)
tree231b342bc63446f467bed99fe79bfce1c29f8854
parent15ebf2cd2908415491c2710caa2ee7f3e0ef47ef (diff)
downloadsamba-576e17cbf3fe10cb8338ab00eeea6211266af390.tar.gz
samba-576e17cbf3fe10cb8338ab00eeea6211266af390.tar.bz2
samba-576e17cbf3fe10cb8338ab00eeea6211266af390.zip
r14831: Fix possible null deref. Coverity #279.
Jeremy. (This used to be commit 75be5c17bc74c86219c7cac749b52b7d43abb780)
-rw-r--r--source3/utils/net_ads.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 5f5e1aa5ea..dd53cc5289 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -1045,6 +1045,13 @@ static int net_ads_printer_publish(int argc, const char **argv)
asprintf(&prt_dn, "cn=%s-%s,%s", srv_cn[0], printername, srv_dn);
pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SPOOLSS, &nt_status);
+ if (!pipe_hnd) {
+ d_fprintf(stderr, "Unable to open a connnection to the spoolss pipe on %s\n",
+ servername);
+ ads_destroy(&ads);
+ return -1;
+ }
+
get_remote_printer_publishing_data(pipe_hnd, mem_ctx, &mods,
printername);