X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Fhandle.c;h=cd4997d8cc4a3e34eb116ad1bc1c29c5bfd2155b;hb=f99f0ec855b82620c45b4c539ef7d3832680db0d;hp=db79933c9e6c82321b93a0f8cc50c53ed93d75e5;hpb=cb71a803fb168f500ad7c7dc36ad4bc9ba7c03a1;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/handle.c b/KernelLand/Kernel/vfs/handle.c index db79933c..cd4997d8 100644 --- a/KernelLand/Kernel/vfs/handle.c +++ b/KernelLand/Kernel/vfs/handle.c @@ -248,10 +248,13 @@ void VFS_RestoreHandles(int NumFDs, void *Handles) if( !MM_GetPhysAddr(h) ) { - if( !MM_Allocate( (tVAddr)h & ~(PAGE_SIZE-1) ) ) + void *pg = (void*)( (tVAddr)h & ~(PAGE_SIZE-1) ); + if( !MM_Allocate( (tVAddr)pg ) ) { // OOM? + return ; } + memset(pg, 0, PAGE_SIZE); } // Safe to dereference, as Threads_CloneTCB references handles #if 1