Unsafe use of strncpy replaced by strlcpy. CID 2259.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40626 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -167,10 +167,10 @@ _BJoystickTweaker::_BuildFromJoystickDesc(char *string, _joystick_info* info)
|
|||||||
|
|
||||||
if (str.IFindFirst("module") != -1) {
|
if (str.IFindFirst("module") != -1) {
|
||||||
str.RemoveFirst("module = ");
|
str.RemoveFirst("module = ");
|
||||||
strncpy(info->module_name, str.String(), STRINGLENGTHCPY);
|
strlcpy(info->module_name, str.String(), STRINGLENGTHCPY);
|
||||||
} else if (str.IFindFirst("gadget") != -1) {
|
} else if (str.IFindFirst("gadget") != -1) {
|
||||||
str.RemoveFirst("gadget = ");
|
str.RemoveFirst("gadget = ");
|
||||||
strncpy(info->controller_name, str.String(), STRINGLENGTHCPY);
|
strlcpy(info->controller_name, str.String(), STRINGLENGTHCPY);
|
||||||
} else if (str.IFindFirst("num_axes") != -1) {
|
} else if (str.IFindFirst("num_axes") != -1) {
|
||||||
str.RemoveFirst("num_axes = ");
|
str.RemoveFirst("num_axes = ");
|
||||||
info->num_axes = atoi(str.String());
|
info->num_axes = atoi(str.String());
|
||||||
|
|||||||
Reference in New Issue
Block a user