r3848: Fix for bug 2057. Only partially applied the patch, the second part seems not
authorVolker Lendecke <vlendec@samba.org>
Thu, 18 Nov 2004 15:13:58 +0000 (15:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:20 +0000 (10:53 -0500)
necessary.

I'm using gcc 3.4.1, this does not detect the possibly uninitialized
variable. Does anybody know how to get 3.4.1 to warn me?

Volker
(This used to be commit 8b6f8f93a0f30be0184e6044a499c1ef8f7b247e)

source3/smbd/lanman.c

index aeea9de9ca39f9fb5f7bbd020121deef41d21503..5f4c0cec52cf48bebedfee0fe5f1429f78c35513 100644 (file)
@@ -2146,6 +2146,12 @@ static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid, char *param
                goto out;
        }
 
+       snum = lp_servicenumber( sharename);
+       if (snum == -1) {
+               errcode = NERR_DestNotFound;
+               goto out;
+       }
+
        errcode = NERR_notsupported;
        
        switch (function) {
@@ -2971,6 +2977,7 @@ static BOOL api_WPrintJobGetInfo(connection_struct *conn,uint16 vuid, char *para
   if(!rap_to_pjobid(SVAL(p,0), sharename, &jobid))
     return False;
 
+  snum = lp_servicenumber( sharename);
   if (snum < 0 || !VALID_SNUM(snum)) return(False);
 
   count = print_queue_status(snum,&queue,&status);