]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed possible buffer overflow in wxXmlResource::GetXRCID() (patch #11715).
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 11 Feb 2010 12:36:16 +0000 (12:36 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 11 Feb 2010 12:36:16 +0000 (12:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/xrc/xmlres.cpp

index 5b41a453aa18fff42899d09a1c837c9d9e40fe67..88fa86ab4ac56e28626e4d72173eea07a6ec8609 100644 (file)
@@ -1996,9 +1996,9 @@ static XRCID_record *XRCID_Records[XRCID_TABLE_SIZE] = {NULL};
 
 static int XRCID_Lookup(const char *str_id, int value_if_not_found = wxID_NONE)
 {
-    int index = 0;
+    unsigned int index = 0;
 
-    for (const char *c = str_id; *c != '\0'; c++) index += (int)*c;
+    for (const char *c = str_id; *c != '\0'; c++) index += (unsigned int)*c;
     index %= XRCID_TABLE_SIZE;
 
     XRCID_record *oldrec = NULL;