Skip to content

Commit

Permalink
fix: Do not modify default_attributes_parameters in MISPObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Sep 15, 2020
1 parent 781161f commit c39328f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymisp/mispevent.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from datetime import timezone, datetime, date
import copy
import json
import os
import base64
Expand Down Expand Up @@ -603,7 +604,7 @@ class MISPObject(AbstractMISP):
'sharing_group_id', 'comment', 'first_seen', 'last_seen',
'deleted'}

def __init__(self, name: str, strict: bool = False, standalone: bool = True, default_attributes_parameters: dict = {}, **kwargs):
def __init__(self, name: str, strict: bool = False, standalone: bool = True, default_attributes_parameters: Dict = {}, **kwargs):
''' Master class representing a generic MISP object
:name: Name of the object
Expand Down Expand Up @@ -637,7 +638,7 @@ def __init__(self, name: str, strict: bool = False, standalone: bool = True, def
# Just make sure we're not modifying an existing MISPAttribute
self._default_attributes_parameters = default_attributes_parameters.to_dict()
else:
self._default_attributes_parameters = default_attributes_parameters
self._default_attributes_parameters = copy.copy(default_attributes_parameters)
if self._default_attributes_parameters:
# Let's clean that up
self._default_attributes_parameters.pop('value', None) # duh
Expand Down

0 comments on commit c39328f

Please sign in to comment.