From 2e00a8a74b7c5c95b61e6c7f365ed852c7d95289 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Mar 2010 17:09:23 -0700 Subject: 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. --- source3/smbd/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3') 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)); -- cgit