diff options
author | asharif@chromium.org <asharif@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-02 08:31:17 +0000 |
---|---|---|
committer | asharif@chromium.org <asharif@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-02 08:31:17 +0000 |
commit | 518d97247f6d93b82106f60dd67844646493ac17 (patch) | |
tree | eee82b448a7b3e3646dc56f5c697e189a691aa54 | |
parent | 7c5ff9a739c8a826de06a50acddacfdc9f0d0c8f (diff) | |
download | chromium_src-518d97247f6d93b82106f60dd67844646493ac17.zip chromium_src-518d97247f6d93b82106f60dd67844646493ac17.tar.gz chromium_src-518d97247f6d93b82106f60dd67844646493ac17.tar.bz2 |
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
-rw-r--r-- | third_party/mongoose/README.chromium | 1 | ||||
-rw-r--r-- | third_party/mongoose/chrome-mongoose-modifications.diff | 19 | ||||
-rw-r--r-- | third_party/mongoose/mongoose.c | 4 |
3 files changed, 24 insertions, 0 deletions
diff --git a/third_party/mongoose/README.chromium b/third_party/mongoose/README.chromium index 97e264a..637721c 100644 --- a/third_party/mongoose/README.chromium +++ b/third_party/mongoose/README.chromium @@ -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). diff --git a/third_party/mongoose/chrome-mongoose-modifications.diff b/third_party/mongoose/chrome-mongoose-modifications.diff index 0f80a8b..b37162d 100644 --- a/third_party/mongoose/chrome-mongoose-modifications.diff +++ b/third_party/mongoose/chrome-mongoose-modifications.diff @@ -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 + diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c index bdf70618..67ec9bd 100644 --- a/third_party/mongoose/mongoose.c +++ b/third_party/mongoose/mongoose.c @@ -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 |