[Samba] [2.6 patch] fs/smbfs/request.c: turn NULL dereference into BUG()

Adrian Bunk bunk at stusta.de
Sat Mar 26 13:11:32 GMT 2005


On Sat, Mar 26, 2005 at 01:53:01PM +0100, Adrian Bunk wrote:
>...
> The problem is actually only in the SMB_RECV_END and SMB_RECV_REQUEST 
> cases and all code after the NULL pointer dereference is actually dead 
> code.
>...

OK, this was also wrong...

Third try.

cu
Adrian


<--  snip  -->


In a case documented as

  We should never be called with any of these states

BUG() in a case that would later result in a NULL pointer dereference.

Signed-off-by: Adrian Bunk <bunk at stusta.de>

--- linux-2.6.12-rc1-mm3-full/fs/smbfs/request.c.old	2005-03-26 13:19:19.000000000 +0100
+++ linux-2.6.12-rc1-mm3-full/fs/smbfs/request.c	2005-03-26 13:41:30.000000000 +0100
@@ -786,8 +642,7 @@ int smb_request_recv(struct smb_sb_info 
 		/* We should never be called with any of these states */
 	case SMB_RECV_END:
 	case SMB_RECV_REQUEST:
-		server->rstate = SMB_RECV_END;
-		break;
+		BUG();
 	}
 
 	if (result < 0) {


More information about the samba mailing list