Welcome! Log In Create A New Profile

Advanced

[nginx] gRPC: fixed possible sign extension of error and setting_value.

Maxim Dounin
March 22, 2018 02:10PM
details: http://hg.nginx.org/nginx/rev/070c972336c4
branches:
changeset: 7249:070c972336c4
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Mar 22 19:26:25 2018 +0300
description:
gRPC: fixed possible sign extension of error and setting_value.

All cases are harmless and should not happen on valid values, though can
result in bad values being shown incorrectly in logs.

Found by Coverity (CID 1430311, 1430312, 1430313).

diffstat:

src/http/modules/ngx_http_grpc_module.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff --git a/src/http/modules/ngx_http_grpc_module.c b/src/http/modules/ngx_http_grpc_module.c
--- a/src/http/modules/ngx_http_grpc_module.c
+++ b/src/http/modules/ngx_http_grpc_module.c
@@ -3212,7 +3212,7 @@ ngx_http_grpc_parse_rst_stream(ngx_http_
switch (state) {

case sw_start:
- ctx->error = ch << 24;
+ ctx->error = (ngx_uint_t) ch << 24;
state = sw_error_2;
break;

@@ -3325,7 +3325,7 @@ ngx_http_grpc_parse_goaway(ngx_http_requ
break;

case sw_error:
- ctx->error = ch << 24;
+ ctx->error = (ngx_uint_t) ch << 24;
state = sw_error_2;
break;

@@ -3555,7 +3555,7 @@ ngx_http_grpc_parse_settings(ngx_http_re
break;

case sw_value:
- ctx->setting_value = ch << 24;
+ ctx->setting_value = (ngx_uint_t) ch << 24;
state = sw_value_2;
break;

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

[nginx] gRPC: fixed possible sign extension of error and setting_value.

Maxim Dounin 622 March 22, 2018 02:10PM



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

Online Users

Guests: 233
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