From 60011ca520b2632204b59b6dd7cc37a05dae7fab Mon Sep 17 00:00:00 2001 From: HD Moore Date: Sat, 17 Aug 2013 15:10:50 -0500 Subject: [PATCH] Clarify order of operations for compare --- src/output_modules/module_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output_modules/module_json.c b/src/output_modules/module_json.c index 73ae1e6..b8ccd51 100644 --- a/src/output_modules/module_json.c +++ b/src/output_modules/module_json.c @@ -219,7 +219,7 @@ int json_output_file_ip(ipaddr_n_t saddr, ipaddr_n_t daddr, gettimeofday(&t, NULL); json_output_file_store_tv(obj, &t); - if ((ip_hdr->protocol == IPPROTO_UDP || ip_hdr->protocol == IPPROTO_ICMP) && buflen - data_offset > 0) + if ((ip_hdr->protocol == IPPROTO_UDP || ip_hdr->protocol == IPPROTO_ICMP) && (buflen - data_offset) > 0) json_output_file_store_data(obj, packet + data_offset, buflen - data_offset); fprintf(file, "%s\n", json_object_to_json_string(obj));