s3: Slightly simplify smbd_smb2_request_next_vector
authorVolker Lendecke <vl@samba.org>
Fri, 6 May 2011 09:26:56 +0000 (11:26 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 12 May 2011 09:48:29 +0000 (11:48 +0200)
Metze, Jeremy, please check!

source3/smbd/smb2_server.c

index 1bb3cc22ce9e187dc814b7e1717d0261d24c68b7..7752fb07b5f16a857cb96c20d3d66ed519cf42e6 100644 (file)
@@ -2018,9 +2018,11 @@ static int smbd_smb2_request_next_vector(struct tstream_context *stream,
                                invalid = true;
                        }
 
-                       if ((body_size % 2) != 0) {
-                               body_size -= 1;
-                       }
+                       /*
+                        * Mask out the lowest bit, the "dynamic" part
+                        * of body_size.
+                        */
+                       body_size &= ~1;
 
                        if (body_size > (full_size - SMB2_HDR_BODY)) {
                                /*