You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i was trying to use maloader to run a CLI OSx binary on kubuntu 11.10, 64bit. The program starts up and is able to show its basic usage to the console. however, it crashes when trying to use it to do more stuff. using gdb, i tracked the crash back to "int __darwin_fflush(__darwin_FILE* fp)". it is somehow being passed a NULL pointer, which isnt handled, and leads to a segfault. changing this function to check for NULL pointer fixes the crash and the program runs normally.
i was trying to use maloader to run a CLI OSx binary on kubuntu 11.10, 64bit. The program starts up and is able to show its basic usage to the console. however, it crashes when trying to use it to do more stuff. using gdb, i tracked the crash back to "int __darwin_fflush(__darwin_FILE* fp)". it is somehow being passed a NULL pointer, which isnt handled, and leads to a segfault. changing this function to check for NULL pointer fixes the crash and the program runs normally.
the man page for fflush() says that it is supposed to handle NULL pointer as a special case.
http://www.manpagez.com/man/3/fflush/
this is how i have changed it in my own code. i havents actually looked into how maloader is working, so it may be completely wrong.
int __darwin_fflush(__darwin_FILE* fp) {
if( !fp )
{
return fflush( NULL );
}
return fflush(fp->linux_fp);
}
The text was updated successfully, but these errors were encountered: