Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
fix: removal of unsafe eval call (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
weliasz authored Oct 19, 2021
1 parent 0e87f17 commit 843c26a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions splunk_connect_for_snmp_poller/manager/task_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,13 @@ def _sort_walk_data(
if is_metric:
merged_result_metric.append(varbind)
result_to_send_to_hec = varbind
merged_result.append(eval(varbind))
merged_result.append(json.loads(varbind))
else:
merged_result_non_metric.append(varbind)
result_dict = eval(varbind)
result_dict = json.loads(varbind)
metric_part = result_dict["metric"]
if isinstance(metric_part, str):
metric_part = eval(metric_part)
metric_part = json.loads(metric_part)
merged_result.append(metric_part)
result_to_send_to_hec = result_dict["non_metric"]
return result_to_send_to_hec
Expand Down

0 comments on commit 843c26a

Please sign in to comment.