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

Commit 843c26a

Browse files
authored
fix: removal of unsafe eval call (#157)
1 parent 0e87f17 commit 843c26a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

splunk_connect_for_snmp_poller/manager/task_utilities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,13 @@ def _sort_walk_data(
619619
if is_metric:
620620
merged_result_metric.append(varbind)
621621
result_to_send_to_hec = varbind
622-
merged_result.append(eval(varbind))
622+
merged_result.append(json.loads(varbind))
623623
else:
624624
merged_result_non_metric.append(varbind)
625-
result_dict = eval(varbind)
625+
result_dict = json.loads(varbind)
626626
metric_part = result_dict["metric"]
627627
if isinstance(metric_part, str):
628-
metric_part = eval(metric_part)
628+
metric_part = json.loads(metric_part)
629629
merged_result.append(metric_part)
630630
result_to_send_to_hec = result_dict["non_metric"]
631631
return result_to_send_to_hec

0 commit comments

Comments
 (0)