From: Enji Cooper Date: Sat, 28 Mar 2020 00:24:53 +0000 (-0700) Subject: Don't accumulate arguments in `Entry.GetTranslation` X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47a2bcf6e844292c7754cf9bd726a5416e5ad24a;p=libevent Don't accumulate arguments in `Entry.GetTranslation` Initialize `extradict` safely to avoid accumulating arguments in dict objects passed in across calls. Signed-off-by: Enji Cooper --- diff --git a/event_rpcgen.py b/event_rpcgen.py index 590b4eb4..8e9ed1fc 100755 --- a/event_rpcgen.py +++ b/event_rpcgen.py @@ -484,7 +484,9 @@ class Entry: "around line %d" % (self._name, self.LineCount()) ) - def GetTranslation(self, extradict={}): + def GetTranslation(self, extradict=None): + if extradict is None: + extradict = {} mapping = { "parent_name": self._struct.Name(), "name": self._name,