1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Fix an off-by-one error (really off-by-2 in this case) in the buffer

resize logic of json1.

FossilOrigin-Name: d2a027372a5a6efc0f9b6f605093d865ae1c6788
This commit is contained in:
drh
2015-09-19 11:57:26 +00:00
parent 4cbc54b042
commit 4977ccf143
4 changed files with 19 additions and 9 deletions

View File

@@ -285,4 +285,13 @@ do_execsql_test json102-1132 {
do_execsql_test json102-1201 { SELECT json_valid(char(32) || '"xyz"') } 1
do_execsql_test json102-1202 { SELECT json_valid(char(200) || '"xyz"') } 0
# Off-by-one error in jsonAppendString()
#
for {set i 0} {$i<100} {incr i} {
set str abcdef[string repeat \" [expr {$i+50}]]uvwxyz
do_test json102-[format %d [expr {$i+1300}]] {
db eval {SELECT json_extract(json_array($::str),'$[0]')==$::str}
} {1}
}
finish_test