From 8a9165589d17d641ac95c09a3b4e646ef35bb320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C3=85strand?= Date: Fri, 30 Dec 2005 20:32:06 +0000 Subject: [PATCH] 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 --- rdesktop.c | 2 +- secure.c | 2 +- xkeymap.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rdesktop.c b/rdesktop.c index 57796de..7a24869 100644 --- a/rdesktop.c +++ b/rdesktop.c @@ -51,7 +51,7 @@ char g_title[64] = ""; char g_username[64]; char g_hostname[16]; 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_subtype = 0x0; /* Defaults to US keyboard layout */ int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */ diff --git a/secure.c b/secure.c index d11fc60..b984219 100644 --- a/secure.c +++ b/secure.c @@ -29,7 +29,7 @@ extern char g_hostname[16]; extern int g_width; extern int g_height; -extern int g_keylayout; +extern unsigned int g_keylayout; extern int g_keyboard_type; extern int g_keyboard_subtype; extern int g_keyboard_functionkeys; diff --git a/xkeymap.c b/xkeymap.c index 5d1872b..0022ff4 100644 --- a/xkeymap.c +++ b/xkeymap.c @@ -41,7 +41,7 @@ extern Display *g_display; extern Window g_wnd; extern char g_keymapname[16]; -extern int g_keylayout; +extern unsigned int g_keylayout; extern int g_keyboard_type; extern int g_keyboard_subtype; extern int g_keyboard_functionkeys; @@ -321,7 +321,7 @@ xkeymap_read(char *mapname) /* 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)); continue; }