Open someone005 opened 2 months ago
It should be noted that this will happen if you return any invalid data during any of this, this entire section expects the end user to never send any invalid data via the callback.
Yeah, it should noted, but there's one thing. Why the same data passed to RegisterNUICallback cb function doesn't crash the game?
This is a "raw callback" you're expected to return an empty table if you don't want to return anything, or a table with this kind of structure
struct RequestCallback {
// optional, doesn't have to be set
// headers to set for the call back
Array<(string, string)> headers;
// alternate to returning an array
IDictionary<string, string> headers;
// optional, doesn't have to be set
// the status code
int status;
// optional, doesn't have to be set
// the data to return
string body;
}
Here's a patch patch I wrote up yesterday, though its not the cleanest, nor is it tested.
What happened?
I discovered that if you pass empty string to callback function, it will cause game crash.
Video
LUA Code:
NUI JS Code
Expected result
Callback data should be properly packed
Reproduction steps
Importancy
Crash
Area(s)
Natives
Specific version(s)
FiveM: 9837 Server: 9481 Windows
Additional information
No response