Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #663 from moshekaplan/patch-1
Prevent potential buffer overflow in sscanf
  • Loading branch information
Sonicadvance1 committed Jul 23, 2014
2 parents 008b907 + cd8b65b commit e91db62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Core/DolphinWX/Android/ButtonManager.cpp
Expand Up @@ -117,13 +117,13 @@ namespace ButtonManager
{
hasbind = true;
type = BIND_AXIS;
sscanf(value.c_str(), "Device '%[^\']'-Axis %d%c", dev, &bindnum, &modifier);
sscanf(value.c_str(), "Device '%127[^\']'-Axis %d%c", dev, &bindnum, &modifier);
}
else if (std::string::npos != value.find("Button"))
{
hasbind = true;
type = BIND_BUTTON;
sscanf(value.c_str(), "Device '%[^\']'-Button %d", dev, &bindnum);
sscanf(value.c_str(), "Device '%127[^\']'-Button %d", dev, &bindnum);
}
if (hasbind)
AddBind(std::string(dev), new sBind(padID, configTypes[a], type, bindnum, modifier == '-' ? -1.0f : 1.0f));
Expand Down

0 comments on commit e91db62

Please sign in to comment.