Index: generic/nsfObj.c =================================================================== diff -u -r658c5ca127345b3f4377e551d5e9517c6481b473 -r207a8f514cdf626259fdbfa3bc525bdb0339efa0 --- generic/nsfObj.c (.../nsfObj.c) (revision 658c5ca127345b3f4377e551d5e9517c6481b473) +++ generic/nsfObj.c (.../nsfObj.c) (revision 207a8f514cdf626259fdbfa3bc525bdb0339efa0) @@ -423,9 +423,10 @@ NsfClass *mixin = NULL; Tcl_Obj *guardObj = NULL, *nameObj = NULL; Mixinreg *mixinRegPtr; - int oc; Tcl_Obj **ov; + int oc, result; Tcl_Obj **ov; - if (Tcl_ListObjGetElements(interp, objPtr, &oc, &ov) == TCL_OK) { + result = Tcl_ListObjGetElements(interp, objPtr, &oc, &ov); + if (result == TCL_OK) { if (oc == 1) { nameObj = ov[0]; @@ -443,7 +444,8 @@ } } else { - return NsfObjErrType(interp, "mixin", nameObj, "a class as mixin", NULL); + /* invalid Tcl list */ + return result; } /* Index: tests/interceptor-slot.test =================================================================== diff -u -r0f881e4bc45e927c8d84c1b1b468ef7537cb9b03 -r207a8f514cdf626259fdbfa3bc525bdb0339efa0 --- tests/interceptor-slot.test (.../interceptor-slot.test) (revision 0f881e4bc45e927c8d84c1b1b468ef7537cb9b03) +++ tests/interceptor-slot.test (.../interceptor-slot.test) (revision 207a8f514cdf626259fdbfa3bc525bdb0339efa0) @@ -158,6 +158,31 @@ ? {O info precedence} "::M1 ::nx::Class ::nx::Object" } +nx::test case mixin-relation-invalid-value { + + nx::Class create C + nx::Class create M + + # Double-escaping allows for injecting an invalid string rep of a Tcl + # list into MixinregSetFromAny(). Other API facets (::nsf::mixin) + # catch this through list ops at the script level. + + set ::str "\\\{ ::M" + ? {lindex [subst $::str] 0} "unmatched open brace in list" + ? {C mixins get} "" + ? {C object mixins get} "" + ? {::nsf::relation::set C class-mixin $::str} "unmatched open brace in list" + ? {::nsf::relation::set C object-mixin $::str} "unmatched open brace in list" + ? {C mixins get} "" + ? {C object mixins get} "" + + # via slot interface + ? {C mixins set $::str} "unmatched open brace in list" + ? {C object mixins set $::str} "unmatched open brace in list" + +} + + nx::test case filter-relation { nx::Class create CC { :public method filterA args {next}