Applied patch #1367109: prevent strtol overflow

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1034 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2005-12-30 20:32:06 +00:00
parent 098d205563
commit 8a9165589d
3 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ char g_title[64] = "";
char g_username[64]; char g_username[64];
char g_hostname[16]; char g_hostname[16];
char g_keymapname[PATH_MAX] = ""; char g_keymapname[PATH_MAX] = "";
int g_keylayout = 0x409; /* Defaults to US keyboard layout */ unsigned int g_keylayout = 0x409; /* Defaults to US keyboard layout */
int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */ int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */ int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */ int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */

View File

@ -29,7 +29,7 @@
extern char g_hostname[16]; extern char g_hostname[16];
extern int g_width; extern int g_width;
extern int g_height; extern int g_height;
extern int g_keylayout; extern unsigned int g_keylayout;
extern int g_keyboard_type; extern int g_keyboard_type;
extern int g_keyboard_subtype; extern int g_keyboard_subtype;
extern int g_keyboard_functionkeys; extern int g_keyboard_functionkeys;

View File

@ -41,7 +41,7 @@
extern Display *g_display; extern Display *g_display;
extern Window g_wnd; extern Window g_wnd;
extern char g_keymapname[16]; extern char g_keymapname[16];
extern int g_keylayout; extern unsigned int g_keylayout;
extern int g_keyboard_type; extern int g_keyboard_type;
extern int g_keyboard_subtype; extern int g_keyboard_subtype;
extern int g_keyboard_functionkeys; extern int g_keyboard_functionkeys;
@ -321,7 +321,7 @@ xkeymap_read(char *mapname)
/* map */ /* map */
if (str_startswith(line, "map ")) if (str_startswith(line, "map "))
{ {
g_keylayout = strtol(line + sizeof("map ") - 1, NULL, 16); g_keylayout = strtoul(line + sizeof("map ") - 1, NULL, 16);
DEBUG_KBD(("Keylayout 0x%x\n", g_keylayout)); DEBUG_KBD(("Keylayout 0x%x\n", g_keylayout));
continue; continue;
} }