r5806: * fix a couple more segvs in spoolss
authorGerald Carter <jerry@samba.org>
Tue, 15 Mar 2005 20:12:51 +0000 (20:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:02 +0000 (10:56 -0500)
* comment out unused variable after jra's change to revert the 56bit des
  smb signing changes
(This used to be commit 13ed08cd2a1097021cc44f4109859ba89db7df81)

source3/libsmb/smb_signing.c
source3/rpc_server/srv_spoolss.c
source3/rpc_server/srv_spoolss_nt.c

index 500ff7cc6e2113e7d43e97a0f432132044711d3a..f0f2024e7b9ff9f0ac477e36ddfb160d23c92732 100644 (file)
@@ -255,7 +255,10 @@ static void simple_packet_signature(struct smb_basic_signing_context *data,
        const size_t offset_end_of_sig = (smb_ss_field + 8);
        unsigned char sequence_buf[8];
        struct MD5Context md5_ctx;
+#if 0
+        /* JRA - apparently this is incorrect. */
        unsigned char key_buf[16];
+#endif
 
        /*
         * Firstly put the sequence number into the first 4 bytes.
index f846813a40b86be85dc653b428e60ae4f316fc47..b3a67dd6cfd540eb309179339af70c81c6f4b9c9 100755 (executable)
@@ -1244,6 +1244,9 @@ static BOOL api_spoolss_getjob(pipes_struct *p)
        prs_struct *data = &p->in_data.data;
        prs_struct *rdata = &p->out_data.rdata;
        
+       ZERO_STRUCT(q_u);
+       ZERO_STRUCT(r_u);
+       
        if(!spoolss_io_q_getjob("", &q_u, data, 0)) {
                DEBUG(0,("spoolss_io_q_getjob: unable to unmarshall SPOOL_Q_GETJOB.\n"));
                return False;
index 053290f80fea5d571f7c34aaed99768e1f0bf12c..3c611be9ace60860e916f7fe1cabcec7d6e7e94a 100644 (file)
@@ -8752,30 +8752,25 @@ static WERROR getjob_level_2(print_queue_struct **queue, int count, int snum,
        int             i = 0;
        BOOL            found = False;
        JOB_INFO_2      *info_2;
-       WERROR          ret;
+       WERROR          result;
        DEVICEMODE      *devmode = NULL;
        NT_DEVICEMODE   *nt_devmode = NULL;
 
-       info_2=SMB_MALLOC_P(JOB_INFO_2);
+       if ( !(info_2=SMB_MALLOC_P(JOB_INFO_2)) )
+               return WERR_NOMEM;
 
        ZERO_STRUCTP(info_2);
 
-       if (info_2 == NULL) {
-               ret = WERR_NOMEM;
-               goto done;
-       }
-
        for ( i=0; i<count && found==False; i++ ) 
        {
                if ((*queue)[i].job == (int)jobid)
                        found = True;
        }
        
-       if ( !found ) 
-       {
+       if ( !found ) {
                /* NT treats not found as bad param... yet another bad
                   choice */
-               ret = WERR_INVALID_PARAM;
+               result = WERR_INVALID_PARAM;
                goto done;
        }
        
@@ -8799,18 +8794,18 @@ static WERROR getjob_level_2(print_queue_struct **queue, int count, int snum,
        *needed += spoolss_size_job_info_2(info_2);
 
        if (*needed > offered) {
-               ret = WERR_INSUFFICIENT_BUFFER;
+               result = WERR_INSUFFICIENT_BUFFER;
                goto done;
        }
 
        if (!rpcbuf_alloc_size(buffer, *needed)) {
-               ret = WERR_INSUFFICIENT_BUFFER;
+               result = WERR_NOMEM;
                goto done;
        }
 
        smb_io_job_info_2("", buffer, info_2, 0);
 
-       ret = WERR_OK;
+       result = WERR_OK;
        
  done:
        /* Cleanup allocated memory */
@@ -8818,7 +8813,7 @@ static WERROR getjob_level_2(print_queue_struct **queue, int count, int snum,
        free_job_info_2(info_2);        /* Also frees devmode */
        SAFE_FREE(info_2);
 
-       return ret;
+       return result;
 }
 
 /****************************************************************************