fork(1) download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. // ORIGINAL:
  6. // char **env, *var;
  7. // env = ngx_set_environment(cycle, &n);
  8. char **env = (char**) malloc(sizeof(char*));
  9.  
  10. // ORIGINAL:
  11. // /* allocate the spare 300 bytes for the new binary process title */
  12. //
  13. // env[n++] = "SPARE=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  14. // "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  15. // "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  16. // "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  17. // "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  18. env[0] = "SPARE=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  19. "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  20. "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  21. "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  22. "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  23.  
  24. // OooPS!
  25. env[0][0] = 'a';
  26.  
  27. puts(env[0]);
  28.  
  29. return EXIT_SUCCESS;
  30. }
Runtime error #stdin #stdout 0s 1784KB
stdin
Standard input is empty
stdout
Standard output is empty