From: Volker Lendecke Date: Thu, 18 Nov 2004 15:13:58 +0000 (+0000) Subject: r3848: Fix for bug 2057. Only partially applied the patch, the second part seems not X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5574 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b6f8f93a0f30be0184e6044a499c1ef8f7b247e;p=thirdparty%2Fsamba.git r3848: Fix for bug 2057. Only partially applied the patch, the second part seems not 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 --- diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c index aeea9de9ca3..5f4c0cec52c 100644 --- a/source/smbd/lanman.c +++ b/source/smbd/lanman.c @@ -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);