frida / frida-gum

Cross-platform instrumentation and introspection library written in C
https://frida.re
Other
727 stars 240 forks source link

Fix: preserved thread's system error over NativeCallback invocations #790

Closed HexKitchen closed 4 months ago

HexKitchen commented 5 months ago

Fix for #789 : NativeCallback unable to leave thread's last error unchanged

Though JavaScript function wrapped as a NativeCallback allows both inspecting and altering the current thread's system error, it wasn't possible to leave the system error as-is. Unless replaced by a value unequal to the original, the system error was being forced to 0 upon return from the NativeCallback. Fixed and tests added.

oleavr commented 5 months ago

Thanks, great catch! 🙌