mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- Fix reading past the end of the pool block.
svn path=/trunk/; revision=8747
This commit is contained in:
parent
94683a5682
commit
60a43e438d
1 changed files with 7 additions and 6 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: keyboard.c,v 1.26 2004/03/11 16:17:25 weiden Exp $
|
||||
/* $Id: keyboard.c,v 1.27 2004/03/15 19:06:35 dwelch Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -541,9 +541,10 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) {
|
|||
|
||||
RtlFreeUnicodeString(&LayoutFile);
|
||||
|
||||
KeyboardLayoutWSTR = ExAllocatePoolWithTag(PagedPool,
|
||||
(FullLayoutPath.Length + 1) *
|
||||
sizeof(WCHAR), TAG_STRING);
|
||||
KeyboardLayoutWSTR =
|
||||
ExAllocatePoolWithTag(PagedPool,
|
||||
FullLayoutPath.Length + sizeof(WCHAR),
|
||||
TAG_STRING);
|
||||
|
||||
if( !KeyboardLayoutWSTR ) {
|
||||
DPRINT1("Couldn't allocate a string for the keyboard layout name.\n");
|
||||
|
@ -551,8 +552,8 @@ void InitKbdLayout( PVOID *pkKeyboardLayout ) {
|
|||
return;
|
||||
}
|
||||
memcpy(KeyboardLayoutWSTR,FullLayoutPath.Buffer,
|
||||
(FullLayoutPath.Length + 1) * sizeof(WCHAR));
|
||||
KeyboardLayoutWSTR[FullLayoutPath.Length] = 0;
|
||||
FullLayoutPath.Length + sizeof(WCHAR));
|
||||
KeyboardLayoutWSTR[FullLayoutPath.Length / sizeof(WCHAR)] = 0;
|
||||
|
||||
kbModule = EngLoadImage(KeyboardLayoutWSTR);
|
||||
DPRINT( "Load Keyboard Layout: %S\n", KeyboardLayoutWSTR );
|
||||
|
|
Loading…
Reference in a new issue