aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <lucaderi@users.noreply.github.com>2020-05-12 13:52:42 +0200
committerGitHub <noreply@github.com>2020-05-12 13:52:42 +0200
commitdb16a987c57c2fa097b5efabb66cef16caeddb03 (patch)
treefd05fa185a11858a73e1edbb047a6949cee3a107
parentf7f705406f103a46672f73e9ffb189286ce6bacf (diff)
parentf8503da9e92e483c1d9839f5578646285b0dce6e (diff)
Merge pull request #896 from IvanNardi/nats
Fix NATS dissector
-rw-r--r--src/lib/protocols/nats.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/nats.c b/src/lib/protocols/nats.c
index a979fdbb9..300cc838d 100644
--- a/src/lib/protocols/nats.c
+++ b/src/lib/protocols/nats.c
@@ -57,7 +57,7 @@ void ndpi_search_nats_tcp(struct ndpi_detection_module_struct *ndpi_struct,
if(!match) continue;
if(ndpi_strnstr((const char *)match, "\r\n",
- flow->packet.payload_packet_len - ((unsigned long)flow->packet.payload - (unsigned long)match)) != NULL) {
+ flow->packet.payload_packet_len - ((unsigned long)match - (unsigned long)flow->packet.payload)) != NULL) {
NDPI_LOG_INFO(ndpi_struct, "found NATS\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NATS, NDPI_PROTOCOL_UNKNOWN);