r814: conn is 0 during ioctl (at least during smbtorture IOCTL test)
authorHerb Lewis <herb@samba.org>
Sat, 22 May 2004 05:01:25 +0000 (05:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:47 +0000 (10:51 -0500)
fix smbd panic

source/smbd/process.c
source/smbd/reply.c

index 283b791afd0603e262d11218a50dbd8f4ed3d381..12fd809b7849f95e23badc2255dab4c5c783b027 100644 (file)
@@ -683,7 +683,7 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize
                uint16 session_tag = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID : SVAL(inbuf,smb_uid);
                connection_struct *conn = conn_find(SVAL(inbuf,smb_tid));
 
-               DEBUG(3,("switch message %s (pid %d)\n",smb_fn_name(type),(int)pid));
+               DEBUG(3,("switch message %s (pid %d) conn 0x%x\n",smb_fn_name(type),(int)pid,(unsigned int)conn));
 
                smb_dump(smb_fn_name(type), 1, inbuf, size);
                if(global_oplock_break) {
index 2046f2370a82915c4b20f9e4ba430712653ba3b1..560208ae157752022336d429e50467deefbd210d 100644 (file)
@@ -489,7 +489,9 @@ int reply_ioctl(connection_struct *conn,
                        }
                        SSVAL(p,0,fsp->rap_print_jobid);             /* Job number */
                        srvstr_push(outbuf, p+2, global_myname(), 15, STR_TERMINATE|STR_ASCII);
-                       srvstr_push(outbuf, p+18, lp_servicename(SNUM(conn)), 13, STR_TERMINATE|STR_ASCII);
+                       if (conn) {
+                               srvstr_push(outbuf, p+18, lp_servicename(SNUM(conn)), 13, STR_TERMINATE|STR_ASCII);
+                       }
                        break;
                }
        }