summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-25 17:09:23 -0700
committerJeremy Allison <jra@samba.org>2010-03-25 17:09:23 -0700
commit2e00a8a74b7c5c95b61e6c7f365ed852c7d95289 (patch)
tree7556574e3e4ade43db3ce4a0da3c28f7ac34f7c0 /source3/smbd
parent462322f6e8f868c8cd6a5cc84cd0af247a04ec1d (diff)
downloadsamba-2e00a8a74b7c5c95b61e6c7f365ed852c7d95289.tar.gz
samba-2e00a8a74b7c5c95b61e6c7f365ed852c7d95289.tar.bz2
samba-2e00a8a74b7c5c95b61e6c7f365ed852c7d95289.zip
Fix bug 7297 - smbd crashes with CUPS printers and no [printers] share defined.
Ensure we don't dereference an array with an index of -1. Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/service.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index db54d46a23..36184af75c 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -339,7 +339,7 @@ int find_service(fstring service)
if ((iPrinterService = lp_servicenumber(PRINTERS_NAME)) < 0) {
iPrinterService = load_registry_service(PRINTERS_NAME);
}
- if (iPrinterService) {
+ if (iPrinterService >= 0) {
DEBUG(3,("checking whether %s is a valid printer name...\n", service));
if (pcap_printername_ok(service)) {
DEBUG(3,("%s is a valid printer name\n", service));