mirror of https://github.com/axmolengine/axmol.git
Processing Lua file(UTF8+BOM) that is encrypted will crash,when free the buffer pointer that is changed pointer address. (#17937)
This commit is contained in:
parent
3e912ffee3
commit
e6210874dd
|
@ -874,8 +874,10 @@ int LuaStack::luaLoadBuffer(lua_State *L, const char *chunk, int chunkSize, cons
|
|||
(unsigned char*)_xxteaKey,
|
||||
(xxtea_long)_xxteaKeyLen,
|
||||
&len);
|
||||
skipBOM((const char*&)result, (int&)len);
|
||||
r = luaL_loadbuffer(L, (char*)result, len, chunkName);
|
||||
unsigned char* content = result;
|
||||
xxtea_long contentSize = len;
|
||||
skipBOM((const char*&)content, (int&)contentSize);
|
||||
r = luaL_loadbuffer(L, (char*)content, contentSize, chunkName);
|
||||
free(result);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue