Commit 518d9724 authored by asharif@chromium.org's avatar asharif@chromium.org

Initialized the variables root and ri.

These were being flagged by gcc-4.6.0 using the Wmaybe-uninitialized warning.

BUG=none
TEST=trybot


Review URL: http://codereview.chromium.org/9309008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124619 0039d316-1c4b-4281-b951-d872f2087c98
parent 7c5ff9a7
......@@ -25,3 +25,4 @@ pending upstreaming by danielwh):
* Don't ignore SIGCHLD, since the proxy launcher depends on it for determining
chrome's exit code.
* Removed a "set but never used" variable, to fix build for gcc 4.6.
* Fixed a compiler warning (-Wmaybe-uninitialized).
......@@ -108,3 +108,22 @@ diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
// Forward client's request to the target
mg_printf(conn->peer, "%s %s HTTP/%s\r\n", ri->request_method, ri->uri + len,
ri->http_version);
@@ -2820,6 +2820,8 @@ static void prepare_cgi_environment(struct mg_connection *conn,
blk->len = blk->nvars = 0;
blk->conn = conn;
+ memset(&root, 0, sizeof(root));
+
get_document_root(conn, &root);
addenv(blk, "SERVER_NAME=%s", conn->ctx->config[AUTHENTICATION_DOMAIN]);
@@ -2916,6 +2918,8 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
FILE *in, *out;
pid_t pid;
+ memset(&ri, 0, sizeof(ri));
+
prepare_cgi_environment(conn, prog, &blk);
// CGI must be executed in its own directory. 'dir' must point to the
......@@ -2820,6 +2820,8 @@ static void prepare_cgi_environment(struct mg_connection *conn,
blk->len = blk->nvars = 0;
blk->conn = conn;
memset(&root, 0, sizeof(root));
get_document_root(conn, &root);
addenv(blk, "SERVER_NAME=%s", conn->ctx->config[AUTHENTICATION_DOMAIN]);
......@@ -2916,6 +2918,8 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
FILE *in, *out;
pid_t pid;
memset(&ri, 0, sizeof(ri));
prepare_cgi_environment(conn, prog, &blk);
// CGI must be executed in its own directory. 'dir' must point to the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment