From d1f4827a40aaf19ad7bcac2c86c9dc4e52dea733 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 27 Jun 2013 19:52:50 +0000 Subject: [PATCH] IK plugin range check was wrong, could do out of bounds reads. --- source/blender/editors/armature/armature_relations.c | 4 ++-- source/blender/ikplugin/intern/ikplugin_api.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index 7ed7ebbb4b9..d5dbe80538f 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -468,8 +468,8 @@ static int separate_armature_exec(bContext *C, wmOperator *UNUSED(op)) /* TODO: use context iterators for this? */ CTX_DATA_BEGIN(C, Base *, base, visible_bases) { - if (base->object == obedit) base->flag |= 1; - else base->flag &= ~1; + if (base->object == obedit) base->flag |= SELECT; + else base->flag &= ~SELECT; } CTX_DATA_END; 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 */