mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
better handling of invalid strings in IntSafeCopyUnicodeString()
svn path=/trunk/; revision=9146
This commit is contained in:
parent
a746bec6f1
commit
b5c06d7dbd
1 changed files with 10 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: misc.c,v 1.60 2004/04/14 23:17:56 weiden Exp $
|
||||
/* $Id: misc.c,v 1.61 2004/04/14 23:40:43 weiden Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -931,10 +931,16 @@ IntSafeCopyUnicodeString(PUNICODE_STRING Dest,
|
|||
return Status;
|
||||
}
|
||||
|
||||
if(Dest->Length > 0)
|
||||
if(Dest->Length > 0x4000)
|
||||
{
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
Src = Dest->Buffer;
|
||||
Dest->Buffer = NULL;
|
||||
|
||||
if(Dest->Length > 0 && Src)
|
||||
{
|
||||
Src = Dest->Buffer;
|
||||
|
||||
Dest->Buffer = ExAllocatePoolWithTag(NonPagedPool, Dest->Length, TAG_STRING);
|
||||
if(!Dest->Buffer)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue