mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
render: don't stomp on meta dictionary
fixes a bug in bulk-process in which rules are evaluated multiple times so meta cannot be updated in place.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
import copy
|
||||
|
||||
import capa.rules
|
||||
import capa.engine
|
||||
import capa.render.utils
|
||||
@@ -202,6 +204,9 @@ def convert_match_to_result_document(rules, capabilities, result):
|
||||
|
||||
|
||||
def convert_meta_to_result_document(meta):
|
||||
# make a copy so that we don't modify the given parameter
|
||||
meta = copy.deepcopy(meta)
|
||||
|
||||
attacks = meta.get("att&ck", [])
|
||||
meta["att&ck"] = [parse_canonical_attack(attack) for attack in attacks]
|
||||
mbcs = meta.get("mbc", [])
|
||||
|
||||
Reference in New Issue
Block a user