Skip to content

Commit

Permalink
Sandbox: Fix loop in CollectMatches() (VirusTotal#1412)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cblichmann authored Dec 2, 2020
1 parent 7732801 commit 07b317e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions bazel/yara_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion sandbox/collect_matches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ int CollectMatches(
meta->set_bytes_value(rule_meta->string);
break;
}
++rule_meta;
}

return ERROR_SUCCESS;
Expand Down

0 comments on commit 07b317e

Please sign in to comment.