aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/http.c
diff options
context:
space:
mode:
authorLuca Deri <lucaderi@users.noreply.github.com>2018-04-16 14:16:09 +0200
committerGitHub <noreply@github.com>2018-04-16 14:16:09 +0200
commit8a59581668047ec0a8c9d5ed778476c398ab7f89 (patch)
treeb5e1dee3ea7d0892b87108264811863a07105842 /src/lib/protocols/http.c
parentd8e4111a9d4158af8246d66d4ab82cbcd990ea6a (diff)
parent5950ad7ef82c329c56d17c11e9b34810180a7c16 (diff)
Merge pull request #547 from zyingp/free-after-detect
Fix several bugs found by Address Sanitizer (ASan)
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r--src/lib/protocols/http.c2
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);