diff options
author | Martin Mathieson <martin.mathieson@keysight.com> | 2020-06-01 17:41:46 +0100 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2020-06-01 17:56:28 +0000 |
commit | 060f876f9794a563267578cca8fe9f5f17d3538d (patch) | |
tree | 5f584ea36a6398a924c398e0a604fe353d3e5f16 /epan/dissectors/packet-http2.c | |
parent | 2ca5a145136e21ecef7e432d4bb50cca3476b06f (diff) |
HTTP2: check return code of a strcmp() call
From a recent cppcheck scan:
epan/dissectors/packet-http2.c:1604: warning: The expression 'strcmp(header_name,"<unknown>") != 0' is suspicious. It overlaps 'strcmp(header_name,":method") == 0'.
epan/dissectors/packet-http2.c:1604: warning: The expression 'strcmp(header_name,"<unknown>") != 0' is suspicious. It overlaps 'strcmp(header_name,":status") == 0'.
Change-Id: I373398112ca9e44d848da4a2b21bd7d059fa049c
Reviewed-on: https://code.wireshark.org/review/37352
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'epan/dissectors/packet-http2.c')
-rw-r--r-- | epan/dissectors/packet-http2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c index f729fd2309..465cb5cbe7 100644 --- a/epan/dissectors/packet-http2.c +++ b/epan/dissectors/packet-http2.c @@ -1601,7 +1601,7 @@ populate_http_header_tracking(tvbuff_t *tvb, packet_info *pinfo, http2_session_t if (strcmp(header_name, HTTP2_HEADER_STATUS) == 0 || strcmp(header_name, HTTP2_HEADER_METHOD) == 0 || /* If we are in the middle of a stream assume there might be data transfer */ - strcmp(header_name, HTTP2_HEADER_UNKNOWN)){ + strcmp(header_name, HTTP2_HEADER_UNKNOWN) == 0){ http2_data_stream_reassembly_info_t *reassembly_info = get_data_reassembly_info(pinfo, h2session); if (reassembly_info->data_initiated_in == 0) { reassembly_info->data_initiated_in = get_http2_frame_num(tvb, pinfo); |