JSValue JSLocation::toStringFunction(ExecState* exec) { Frame* frame = impl()->frame(); if (!frame || !allowsAccessFromFrame(exec, frame)) return jsUndefined(); #if defined(JSC_TAINTED) JSValue s = jsString(exec, impl()->toString()); TaintedCounter* counter = TaintedCounter::getInstance(); unsigned int tainted = counter->getCount(); s.setTainted(tainted); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "JSLocation::toStringFunction"; trace_struct.jsfunc = ""; trace_struct.action = "source"; trace_struct.value = TaintedUtils::UString2string(s.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); return s; #else return jsString(exec, impl()->toString()); #endif }
JSValue jsLocationOrigin(ExecState* exec, JSValue slotBase, const Identifier&) { JSLocation* castedThis = static_cast<JSLocation*>(asObject(slotBase)); UNUSED_PARAM(exec); Location* imp = static_cast<Location*>(castedThis->impl()); JSValue result = jsString(exec, imp->origin()); #ifdef JSC_TAINTED TaintedCounter* counter = TaintedCounter::getInstance(); unsigned int tainted = counter->getCount(); result.setTainted(tainted); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "jsLocationOrigin"; trace_struct.jsfunc = "location.origin"; trace_struct.action = "source"; char msg[20]; stringstream msgss; snprintf(msg, 20, "%s", result.toString(exec).utf8(true).data()); msgss << msg; msgss >> trace_struct.value; TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); #endif return result; }
JSValue jsHTMLElementInnerHTML(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->innerHTML()); #ifdef JSC_TAINTED if (imp->tainted()) { unsigned int tainted = imp->tainted(); result.setTainted(imp->tainted()); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "jsHTMLElementInnerHTML"; trace_struct.jsfunc = "htmlelement.innerHTML"; trace_struct.action = "propagate"; char msg[20]; stringstream msgss; snprintf(msg, 20, "%s", result.toString(exec).utf8(true).data()); msgss << msg; msgss >> trace_struct.value; TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); }
JSValue jsHTMLElementOuterText(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->outerText()); #if defined(JSC_TAINTED) if (imp->tainted()) { unsigned int tainted = imp->tainted(); result.setTainted(imp->tainted()); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "jsHTMLElementOuterText"; trace_struct.jsfunc = "htmlelement.outerText"; trace_struct.action = "propagate"; trace_struct.value = TaintedUtils::UString2string(result.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } #endif return result; }