diff teal-src/util/jsonpointer.tl @ 12496:87c3d45208ef 0.12

util.jsonpointer: Fix off-by-one in array resolution Fixes #1753 Not known to be used anywhere
author Kim Alvefur <zash@zash.se>
date Sun, 08 May 2022 18:04:50 +0200
parents b4c0efff8dd3
children
line wrap: on
line diff
--- a/teal-src/util/jsonpointer.tl	Sun May 08 18:03:44 2022 +0200
+++ b/teal-src/util/jsonpointer.tl	Sun May 08 18:04:50 2022 +0200
@@ -24,7 +24,7 @@
 		elseif idx is integer then
 			local i = tonumber(token)
 			if token == "-" then i = #ref + 1 end
-			new_ref = ref[i]
+			new_ref = ref[i+1]
 		else
 			return nil, "invalid-table"
 		end