diff options
author | Yingpei Zeng <zengyingpei@cmhi.chinamobile.com> | 2018-04-16 16:07:01 +0800 |
---|---|---|
committer | Yingpei Zeng <zengyingpei@cmhi.chinamobile.com> | 2018-04-16 16:07:01 +0800 |
commit | 4b720c4f3c8e74950e1c2b1c6dc10aa2c4c4c73e (patch) | |
tree | 5df3691451659f61dbed598eb8aad60e759bcf38 /src | |
parent | 480791a057ecf4229c19daf52ea7efc487e58ec0 (diff) |
Add length check before do memcmp to "x-steam-sid" in http.c
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/protocols/http.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index ed8d0cd13..7332c5e04 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -663,7 +663,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct /* Check for additional field introduced by Steam */ int x = 1; - if((memcmp(packet->line[x].ptr, "x-steam-sid", 11)) == 0) { + if(packet->line[x].len >= 11 && (memcmp(packet->line[x].ptr, "x-steam-sid", 11)) == 0) { NDPI_LOG_INFO(ndpi_struct, "found STEAM\n"); ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_STEAM); check_content_type_and_change_protocol(ndpi_struct, flow); |