fixed warnings (and potential errors) due to integer overflow when
[samba.git] / source3 / smbd / open.c
index dd1ece7fe13b56af6412f79c9b6c046d89772505..6658b8926f89f50a57f4604d3d7db60578bd0c43 100644 (file)
@@ -574,7 +574,8 @@ static void truncate_unless_locked(files_struct *fsp, connection_struct *conn, i
                                   BOOL *share_locked)
 {
        if (fsp->can_write){
                                   BOOL *share_locked)
 {
        if (fsp->can_write){
-               SMB_OFF_T mask = ((SMB_OFF_T)0xC) << (SMB_OFF_T_BITS-4);
+               SMB_OFF_T mask2 = ((SMB_OFF_T)0x3) << (SMB_OFF_T_BITS-4);
+               SMB_OFF_T mask = (mask2<<2);
                
                if (is_locked(fsp,conn,~mask,0,F_WRLCK)){
                        /* If share modes are in force for this connection we
                
                if (is_locked(fsp,conn,~mask,0,F_WRLCK)){
                        /* If share modes are in force for this connection we