Skip to content

Commit 5b01eef

Browse files
committed
Set a safe limit to http.client response read
1 parent e7b0159 commit 5b01eef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

salt/utils/nxos.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def parse_response(self, response, command_list):
212212
body = response
213213

214214
if self.nxargs["connect_over_uds"]:
215-
body = json.loads(response.read().decode("utf-8"))
215+
max_safe_read = 10 * 1024 * 1024
216+
body = json.loads(response.read(max_safe_read).decode("utf-8"))
216217

217218
# Proceed with caution. The JSON may not be complete.
218219
# Don't just return body['ins_api']['outputs']['output'] directly.

0 commit comments

Comments
 (0)