diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-01-14 22:13:50 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-01-20 16:25:25 -0500 |
commit | 023a985bfc8a627b1e4ccff797fbc33e3d064d6c (patch) | |
tree | 744d4a41bcd50c4dd4514e7ce27e938cfecd6fce /klippy/extras/save_variables.py | |
parent | 5b9beb52f6b417beb619c00b6b92ada6aabd32a8 (diff) | |
download | kutter-023a985bfc8a627b1e4ccff797fbc33e3d064d6c.tar.gz kutter-023a985bfc8a627b1e4ccff797fbc33e3d064d6c.tar.xz kutter-023a985bfc8a627b1e4ccff797fbc33e3d064d6c.zip |
gcode_macro: Use deepcopy() on get_status() results
If a get_status() method returns a mutable object (such as a list or
dict) then it would be possible for a gcode command template to
incorrectly alter the program's internal state. Perform a deepcopy()
operation on all get_status() return results to avoid that.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/save_variables.py')
-rw-r--r-- | klippy/extras/save_variables.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/extras/save_variables.py b/klippy/extras/save_variables.py index 6c88e3cf..f15dbc11 100644 --- a/klippy/extras/save_variables.py +++ b/klippy/extras/save_variables.py @@ -57,7 +57,7 @@ class SaveVariables: gcmd.respond_info("Variable Saved") self.loadVariables() def get_status(self, eventtime): - return {'variables': dict(self.allVariables)} + return {'variables': self.allVariables} def load_config(config): return SaveVariables(config) |