From fe84c6f5e1bb87f3c2e6c7ca9648b8684e710600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 11 Feb 2010 12:36:43 +0000 Subject: [PATCH] Fixed possible buffer overflow in wxXmlResource::GetXRCID() (patch #11715). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@63465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/xrc/xmlres.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index bc0d5a76d9..72179aae7b 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1561,9 +1561,9 @@ static XRCID_record *XRCID_Records[XRCID_TABLE_SIZE] = {NULL}; static int XRCID_Lookup(const wxChar *str_id, int value_if_not_found = wxID_NONE) { - int index = 0; + unsigned int index = 0; - for (const wxChar *c = str_id; *c != wxT('\0'); c++) index += (int)*c; + for (const wxChar *c = str_id; *c != wxT('\0'); c++) index += (unsigned int)*c; index %= XRCID_TABLE_SIZE; XRCID_record *oldrec = NULL;