diff options
author | Stefan Kögl <stefan@skoegl.net> | 2020-01-28 19:03:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-28 19:03:52 +0100 |
commit | b3726f3a8bdcdf0f0841e078228014de8477b0ec (patch) | |
tree | aaaae012bdbbfedf9d1d4951e2663994a8c91f6b /jsonpatch.py | |
parent | 3e44e04f640a1c10b68d00d2b9a6af0c397f06d7 (diff) | |
parent | 041036376a301300ea3dc1a8d236bb61f8567bca (diff) | |
download | python-json-patch-b3726f3a8bdcdf0f0841e078228014de8477b0ec.tar.gz |
Merge pull request #96 from gdraynz/replace-array-indexerror
Ensure an item is within the upper array boundaries before replacing it
Diffstat (limited to 'jsonpatch.py')
-rw-r--r-- | jsonpatch.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jsonpatch.py b/jsonpatch.py index 8ec01d3..a474eae 100644 --- a/jsonpatch.py +++ b/jsonpatch.py @@ -474,7 +474,7 @@ class ReplaceOperation(PatchOperation): return value if isinstance(subobj, MutableSequence): - if part > len(subobj) or part < 0: + if part >= len(subobj) or part < 0: raise JsonPatchConflict("can't replace outside of list") elif isinstance(subobj, MutableMapping): |