You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var V0 = (String ( Number ( "asasa" ) ) !== "NaN");
output:
.../jsish-master/poc.js:1: bug: Ieee function got problem (at or near "asasa")
When StringConstructor() creates the String object, Jsi_ValueToString() will convert the first argument Number ( "asasa" ) to string type. There is a type confusion bug in Jsi_ValueToString() function.
elseif (!interp->logMsgDepth) Jsi_LogBug("Ieee function got problem");
}
break;
}
caseJSI_VT_OBJECT: {
Jsi_Obj*obj=v->d.obj;
switch(obj->ot) {
caseJSI_OT_STRING:
ntxt=obj->d.s.str;
goto done;
caseJSI_OT_BOOL:
ntxt=obj->d.val ? "true":"false";
break;
caseJSI_OT_NUMBER:
d=obj->d.num;
goto fmtnum;
break;
Number ( "asasa" ) is the variable v in above funtion. Since Number ( "asasa" ) is of Object type, jsish executes the JSI_VT_OBJECT case and goes to fmtnum when it finds v->d.obj->ot is of JSI_OT_NUMBER type. However, in jsiValue.c:520, jsish assumes v is of Number type and accesses v->d.num directly, which causes the type confusion.
ISec Lab.
The text was updated successfully, but these errors were encountered:
version: jsish 3.5.0
os: ubuntu 20.04
poc:
output:
When
StringConstructor()
creates theString
object,Jsi_ValueToString()
will convert the first argumentNumber ( "asasa" )
to string type. There is a type confusion bug inJsi_ValueToString()
function.jsish/src/jsiValue.c
Lines 486 to 542 in 4e5066c
Number ( "asasa" )
is the variablev
in above funtion. SinceNumber ( "asasa" )
is of Object type, jsish executes the JSI_VT_OBJECT case and goes tofmtnum
when it findsv->d.obj->ot
is of JSI_OT_NUMBER type. However, in jsiValue.c:520, jsish assumesv
is of Number type and accessesv->d.num
directly, which causes the type confusion.ISec Lab.
The text was updated successfully, but these errors were encountered: