aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2024-01-31 12:15:57 +0000
committerdrh <>2024-01-31 12:15:57 +0000
commitb202a452ad2fd66430dd7d1375ed611cf753f982 (patch)
tree5429cb73b96404d4fcd06fe4d909031980dd2601 /src/json.c
parent91981fe74e223f3fec2b354535e9fac437868765 (diff)
downloadsqlite-b202a452ad2fd66430dd7d1375ed611cf753f982.tar.gz
sqlite-b202a452ad2fd66430dd7d1375ed611cf753f982.zip
Fix a memory allocation bug in the (debug-use-only) json_parse() SQL function.
FossilOrigin-Name: 32ce7dacf58bbf35cf70da8b03fa25f97fcea970edbc1f8aa12739ac4c8608fb
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c
index b683e65a9..8f8196bd7 100644
--- a/src/json.c
+++ b/src/json.c
@@ -3552,11 +3552,12 @@ static void jsonParseFunc(
if( p==0 ) return;
if( argc==1 ){
jsonDebugPrintBlob(p, 0, p->nBlob, 0, &out);
- sqlite3_result_text64(ctx, out.zText, out.nChar, SQLITE_DYNAMIC, SQLITE_UTF8);
+ sqlite3_result_text64(ctx,out.zText,out.nChar,SQLITE_TRANSIENT,SQLITE_UTF8);
}else{
jsonShowParse(p);
}
jsonParseFree(p);
+ sqlite3_str_reset(&out);
}
#endif /* SQLITE_DEBUG */