mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-03 00:42:39 +00:00
Prevent potential buffer overflow in sscanf
This commit is contained in:
parent
008b907bf0
commit
cd8b65bd8a
1 changed files with 2 additions and 2 deletions
|
@ -117,13 +117,13 @@ namespace ButtonManager
|
||||||
{
|
{
|
||||||
hasbind = true;
|
hasbind = true;
|
||||||
type = BIND_AXIS;
|
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"))
|
else if (std::string::npos != value.find("Button"))
|
||||||
{
|
{
|
||||||
hasbind = true;
|
hasbind = true;
|
||||||
type = BIND_BUTTON;
|
type = BIND_BUTTON;
|
||||||
sscanf(value.c_str(), "Device '%[^\']'-Button %d", dev, &bindnum);
|
sscanf(value.c_str(), "Device '%127[^\']'-Button %d", dev, &bindnum);
|
||||||
}
|
}
|
||||||
if (hasbind)
|
if (hasbind)
|
||||||
AddBind(std::string(dev), new sBind(padID, configTypes[a], type, bindnum, modifier == '-' ? -1.0f : 1.0f));
|
AddBind(std::string(dev), new sBind(padID, configTypes[a], type, bindnum, modifier == '-' ? -1.0f : 1.0f));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue