From 65e6fe82ad72f7d1586eebfe950f81284942024f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 24 Aug 2008 12:28:27 +0000 Subject: [PATCH] better check the size of the chars table for keymaps. this avoids crashing in #2659. dunno why the keymap is invalid though git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27183 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/input/InputServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index 230da36136..0556d359e9 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -298,6 +298,8 @@ InputServer::_LoadKeymap() return B_BAD_VALUE; fCharsSize = B_BENDIAN_TO_HOST_INT32(fCharsSize); + if (fCharsSize <= 0) + return B_BAD_VALUE; delete[] fChars; fChars = new (nothrow) char[fCharsSize];