mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 19:19:00 +08:00
Init vars in handle_cgi_request()
This commit is contained in:
parent
74711c686f
commit
f4f73a8dfa
@ -235,7 +235,7 @@ static void prepare_cgi_environment(struct mg_connection *conn,
|
||||
}
|
||||
|
||||
static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
|
||||
int headers_len, data_len, i, fdin[2], fdout[2];
|
||||
int headers_len, data_len, i, fdin[2] = {-1, -1}, fdout[2] = {-1, -1};
|
||||
const char *status, *status_text;
|
||||
char buf[16384], *pbuf, dir[PATH_MAX], *p;
|
||||
struct mg_request_info ri;
|
||||
@ -243,6 +243,7 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
|
||||
FILE *in = NULL, *out = NULL;
|
||||
pid_t pid = (pid_t) -1;
|
||||
|
||||
memset(&ri, 0, sizeof(ri));
|
||||
prepare_cgi_environment(conn, prog, &blk);
|
||||
|
||||
// CGI must be executed in its own directory. 'dir' must point to the
|
||||
|
@ -3253,7 +3253,7 @@ static void prepare_cgi_environment(struct mg_connection *conn,
|
||||
}
|
||||
|
||||
static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
|
||||
int headers_len, data_len, i, fdin[2], fdout[2];
|
||||
int headers_len, data_len, i, fdin[2] = {-1, -1}, fdout[2] = {-1, -1};
|
||||
const char *status, *status_text;
|
||||
char buf[16384], *pbuf, dir[PATH_MAX], *p;
|
||||
struct mg_request_info ri;
|
||||
@ -3261,6 +3261,7 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
|
||||
FILE *in = NULL, *out = NULL;
|
||||
pid_t pid = (pid_t) -1;
|
||||
|
||||
memset(&ri, 0, sizeof(ri));
|
||||
prepare_cgi_environment(conn, prog, &blk);
|
||||
|
||||
// CGI must be executed in its own directory. 'dir' must point to the
|
||||
|
Loading…
Reference in New Issue
Block a user