diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-27 23:52:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-27 23:52:50 +0400 |
commit | d1f4827a40aaf19ad7bcac2c86c9dc4e52dea733 (patch) | |
tree | 708df691aaf5e58b4adeb8e2b6cfc08a17507cf6 /source/blender/ikplugin/intern/ikplugin_api.c | |
parent | e2e487a877b87e0e5dd43d8198f4171b247162cd (diff) |
IK plugin range check was wrong, could do out of bounds reads.
Diffstat (limited to 'source/blender/ikplugin/intern/ikplugin_api.c')
-rw-r--r-- | source/blender/ikplugin/intern/ikplugin_api.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/ikplugin/intern/ikplugin_api.c b/source/blender/ikplugin/intern/ikplugin_api.c index 507d54d7526..2ca50afb0f2 100644 --- a/source/blender/ikplugin/intern/ikplugin_api.c +++ b/source/blender/ikplugin/intern/ikplugin_api.c @@ -86,12 +86,13 @@ static IKPlugin ikplugin_tab[] = { static IKPlugin *get_plugin(bPose *pose) { - if (!pose || pose->iksolver < 0 || pose->iksolver > (sizeof(ikplugin_tab) / sizeof(IKPlugin) - 2)) + if (!pose || pose->iksolver < 0 || pose->iksolver >= ((sizeof(ikplugin_tab) / sizeof(IKPlugin)) - 1)) return NULL; return &ikplugin_tab[pose->iksolver]; } + /*----------------------------------------*/ /* Plugin API */ |