summaryrefslogtreecommitdiff
path: root/jsonpatch.py
diff options
context:
space:
mode:
authorGuillaume Desvé <guillaume.desve@surycat.com>2019-05-16 14:50:00 +0200
committerGuillaume Desvé <guillaume.desve@surycat.com>2019-05-16 14:50:00 +0200
commit041036376a301300ea3dc1a8d236bb61f8567bca (patch)
tree59c1cac99c199508c4416963de11ccf7400eb46d /jsonpatch.py
parent2990bb3d686c09a1550083336365e99247297711 (diff)
downloadpython-json-patch-041036376a301300ea3dc1a8d236bb61f8567bca.tar.gz
Ensure an item is within the upper array boundaries before replacing it
Diffstat (limited to 'jsonpatch.py')
-rw-r--r--jsonpatch.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index 4f8a02b..1b90bfd 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):