This is very wrong!

PtrBCB should never ever be NULL... and if it is then it means that
CcMapData few lines above failed. In fact the whole chunk of code is
wrong. CcMapData return value is not properly checked. If it got far
enough that CcUnpinData crashed then
PtrParentFCB->NTRequiredFCB.CommonFCBHeader.FileSize == 0 and
obviously the mapping will fail. This case can easily be checked
without even attempting to map the data...

Best regards,
Filip Navara

On Sun, Aug 9, 2009 at 7:26 PM, <[email protected]> wrote:
> Author: dgorbachev
> Date: Sun Aug  9 19:26:10 2009
> New Revision: 42569
>
> URL: http://svn.reactos.org/svn/reactos?rev=42569&view=rev
> Log:
> Do not call CcUnpinData() with NULL PtrBCB.
>
> Modified:
>    trunk/reactos/drivers/filesystems/ext2/src/create.c
>
> Modified: trunk/reactos/drivers/filesystems/ext2/src/create.c
> URL: 
> http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/src/create.c?rev=42569&r1=42568&r2=42569&view=diff
> ==============================================================================
> --- trunk/reactos/drivers/filesystems/ext2/src/create.c [iso-8859-1] 
> (original)
> +++ trunk/reactos/drivers/filesystems/ext2/src/create.c [iso-8859-1] Sun Aug  
> 9 19:26:10 2009
> @@ -1410,8 +1410,12 @@
>                        }
>                }
>
> -               CcUnpinData( PtrBCB );
> -               PtrBCB = NULL;
> +               // FIXME
> +               if( PtrBCB )
> +               {
> +                       CcUnpinData( PtrBCB );
> +                       PtrBCB = NULL;
> +               }
>
>                return InodeNo;
>        }
>
>
>

_______________________________________________
Ros-dev mailing list
[email protected]
http://www.reactos.org/mailman/listinfo/ros-dev

Reply via email to