Ticket #1235: fix-sentinel.patch

File fix-sentinel.patch, 2.0 kB (added by Frank DENIS, 1 year ago)

Fix for NULL-terminated argument lists

  • src/mod_scgi.c

    old new  
    790790                        buffer_append_string_buffer(b, host->bin_path); 
    791791 
    792792                        /* exec the cgi */ 
    793                         execle("/bin/sh", "sh", "-c", b->ptr, NULL, env.ptr); 
     793                        execle("/bin/sh", "sh", "-c", b->ptr, (char *) NULL, env.ptr); 
    794794 
    795795                        log_error_write(srv, __FILE__, __LINE__, "sbs", 
    796796                                        "execl failed for:", host->bin_path, strerror(errno)); 
  • src/mod_ssi.c

    old new  
    707707                        /* close stdin */ 
    708708                        close(STDIN_FILENO); 
    709709 
    710                         execl("/bin/sh", "sh", "-c", cmd, NULL); 
     710                        execl("/bin/sh", "sh", "-c", cmd, (char *) NULL); 
    711711 
    712712                        /* */ 
    713713                        SEGFAULT("spawing '%s' failed: %s", cmd, strerror(errno)); 
  • src/spawn-fcgi.c

    old new  
    190190                                strcat(b, appPath); 
    191191 
    192192                                /* exec the cgi */ 
    193                                 execl("/bin/sh", "sh", "-c", b, NULL); 
     193                                execl("/bin/sh", "sh", "-c", b, (char *) NULL); 
    194194 
    195195                                exit(errno); 
    196196 
  • src/mod_accesslog.c

    old new  
    493493                                 * 
    494494                                 */ 
    495495 
    496                                 execl("/bin/sh", "sh", "-c", s->access_logfile->ptr + 1, NULL); 
     496                                execl("/bin/sh", "sh", "-c", s->access_logfile->ptr + 1, (char *) NULL); 
    497497 
    498498                                log_error_write(srv, __FILE__, __LINE__, "sss", 
    499499                                                "spawning log-process failed: ", strerror(errno), 
  • src/proc_open.c

    old new  
    255255                 */ 
    256256                proc_close_parents(proc); 
    257257 
    258                 execl(shell, shell, "-c", command, NULL); 
     258                execl(shell, shell, "-c", command, (char *) NULL); 
    259259                _exit(127); 
    260260 
    261261        } else if (child < 0) {