From 07b317eb8c44a57eee0cc95c33cbb0bb3a964e8f Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Wed, 2 Dec 2020 22:03:07 +0100 Subject: [PATCH] Sandbox: Fix loop in `CollectMatches()` (#1412) The `CollectMatches()` function uses the `yr_rule_metas_foreach()` macro iterate over the rule metadata. The macro expands to a for-loop that already increments the loop variable, so we should not do this again. Drive-by: - Run Buildifier on `bazel/yara_deps.bzl`, deleting a few empty lines Signed-off-by: Christian Blichmann --- bazel/yara_deps.bzl | 2 -- sandbox/collect_matches.cc | 1 - 2 files changed, 3 deletions(-) diff --git a/bazel/yara_deps.bzl b/bazel/yara_deps.bzl index e154b6d080..44b18ed21f 100644 --- a/bazel/yara_deps.bzl +++ b/bazel/yara_deps.bzl @@ -27,12 +27,10 @@ """Load dependencies needed to compile YARA as a 3rd-party consumer.""" - load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - def yara_deps(): """Loads common dependencies needed to compile YARA.""" maybe( diff --git a/sandbox/collect_matches.cc b/sandbox/collect_matches.cc index 322c55a36a..b15c48f84f 100644 --- a/sandbox/collect_matches.cc +++ b/sandbox/collect_matches.cc @@ -71,7 +71,6 @@ int CollectMatches( meta->set_bytes_value(rule_meta->string); break; } - ++rule_meta; } return ERROR_SUCCESS;