Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

MinXmlHttpRequest的一个bug

$
0
0

@footprint 写道:

在参数隐形转化上,如果遇到\0的字符,会导致被数据被截取

/**
* @brief get (raw) responseText
*
*/
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseText)
{
if (_data)
{
std::string correct = std::string(_data, _dataSize);
//jsval strVal = std_string_to_jsval(cx, _data); //bug!
jsval strVal = std_string_to_jsval(cx, correct);

    if (strVal != JSVAL_NULL)
    {
        args.rval().set(strVal);
        return true;
    }
}

CCLOGERROR("ResponseText was empty, probably there is a network error!");

// Return an empty string
args.rval().set(std_string_to_jsval(cx, ""));

return true;

}

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>