Welcome! Log In Create A New Profile

Advanced

[nginx] SPDY: moved a variable initialization near to its check.

Valentin Bartenev
April 10, 2014 09:50AM
details: http://hg.nginx.org/nginx/rev/363395795384
branches:
changeset: 5650:363395795384
user: Valentin Bartenev <vbart@nginx.com>
date: Wed Apr 09 18:15:32 2014 +0400
description:
SPDY: moved a variable initialization near to its check.

This should prevent attempts of using pointer before it was checked, since
all modern compilers are able to spot access to uninitialized variable.

No functional changes.

diffstat:

src/http/ngx_http_spdy.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r e1dcb983d6b3 -r 363395795384 src/http/ngx_http_spdy.c
--- a/src/http/ngx_http_spdy.c Tue Apr 08 20:12:30 2014 +0400
+++ b/src/http/ngx_http_spdy.c Wed Apr 09 18:15:32 2014 +0400
@@ -1412,8 +1412,6 @@ ngx_http_spdy_state_data(ngx_http_spdy_c
{
ngx_http_spdy_stream_t *stream;

- stream = sc->stream;
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
"spdy DATA frame");

@@ -1441,6 +1439,8 @@ ngx_http_spdy_state_data(ngx_http_spdy_c
sc->recv_window = NGX_SPDY_MAX_WINDOW;
}

+ stream = sc->stream;
+
if (stream == NULL) {
return ngx_http_spdy_state_skip(sc, pos, end);
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] SPDY: moved a variable initialization near to its check.

Valentin Bartenev 772 April 10, 2014 09:50AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 191
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready