In this scenario the user will submit his/her C code to my server through a browser. The code will then be compiled and executed on my server and the output will be sent to the
Your question is perhaps equivalent to the halting problem, and probably has no bullet proof answer (think of asm
in malicious C code, forged function pointers, computed goto, buffer overflow trashing the return address, dlsym
& dlopen
, etc.).
As mentioned by Shawn in his comment (referring to this question), you could use sand-boxing techniques. Alinsoar's answer shows you the complexity of the issue.